openapi: 3.1.0
info:
  title: SCIM API
  version: 1.0.0
paths:
  /organizations/{org_id}/Users/{user_id}:
    get:
      operationId: getAUser
      summary: Get a user
      tags:
        - users
      parameters:
        - name: user_id
          in: path
          description: ID of the SCIM User
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    put:
      operationId: updateAUser
      summary: Update a user
      description: >-
        Updates user attributes (currently a no-op). This endpoint exists for identity provider compatibility — no User
        attributes are mutable via SCIM.
      tags:
        - users
      parameters:
        - name: user_id
          in: path
          description: ID of the SCIM User
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
    delete:
      operationId: deleteAUser
      summary: Delete a user
      description: >-
        Removes a user from the organization, including all team and space memberships. Does not delete the user's
        Contentful account.
      tags:
        - users
      parameters:
        - name: user_id
          in: path
          description: ID of the SCIM User
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Request successful, no content returned
          content:
            application/json:
              schema:
                type: object
                properties: {}
    patch:
      operationId: patchAUser
      summary: Patch a user
      description: >-
        Updates user attributes (currently a no-op). This endpoint exists for identity provider compatibility — no User
        attributes are mutable via SCIM.
      tags:
        - users
      parameters:
        - name: user_id
          in: path
          description: ID of the SCIM User
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{org_id}/Users:
    get:
      operationId: getAllUsers
      summary: Get all users
      description: Returns SCIM users for the organization. Filter by email address using `?filter=userName eq "user@example.com"`.
      tags:
        - users
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createAUser
      summary: Create a user
      description: >-
        Creates a user in the organization with the `member` role; new users appear as "Invited" until accepted.
        SSO-enabled organizations do not send invitation emails.
      tags:
        - users
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Resource created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{org_id}/Groups/{group_id}:
    get:
      operationId: getAGroup
      summary: Get a group
      tags:
        - groups
      parameters:
        - name: group_id
          in: path
          description: ID of the Contentful team
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    delete:
      operationId: deleteAGroup
      summary: Delete a group
      description: >-
        Removes a team from the organization. All associated team memberships and team space memberships are also
        removed.
      tags:
        - groups
      parameters:
        - name: group_id
          in: path
          description: ID of the Contentful team
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Request successful, no content returned
          content:
            application/json:
              schema:
                type: object
                properties: {}
    patch:
      operationId: patchAGroup
      summary: Patch a group
      description: >-
        Updates team membership via JSON Patch, supporting `add`, `remove`, and `replace` operations on the `members`
        attribute. Pass a list of user references (with `display` and `value` fields) in the `value` array.
      tags:
        - groups
      parameters:
        - name: group_id
          in: path
          description: ID of the Contentful team
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{org_id}/Groups:
    get:
      operationId: getAllGroups
      summary: Get all groups
      description: Returns SCIM groups for the organization. Filter by name using `?filter=displayName eq "My Group"`.
      tags:
        - groups
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createAGroup
      summary: Create a group
      tags:
        - groups
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Resource created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
servers:
  - url: https://api.contentful.com/scim/v2
    description: SCIM API server
