{
  "openapi": "3.0.0",
  "info": {
    "title": "SCIM API",
    "version": "1",
    "description": "Read users and groups provisioned in your snapAddy organization."
  },
  "servers": [
    {
      "url": "https://backend.snapaddy.com/auth"
    }
  ],
  "tags": [
    {
      "name": "Users"
    },
    {
      "name": "Groups"
    }
  ],
  "paths": {
    "/v1/scim/Users": {
      "get": {
        "operationId": "ScimUsersController_getUsers",
        "summary": "List users",
        "description": "List provisioned users in your organization. Start with the first page, then use a returned ID to retrieve a single user.",
        "tags": [
          "Users"
        ],
        "parameters": [
          {
            "name": "startIndex",
            "required": false,
            "in": "query",
            "description": "The 1-based index of the first query result.",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "count",
            "required": false,
            "in": "query",
            "description": "Non-negative integer. Specifies the desired maximum number of query results per page.",
            "schema": {
              "maximum": 150,
              "default": 25,
              "type": "number"
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Return matching resources. The supported operators are eq and and.",
            "schema": {
              "type": "string",
              "example": "userName eq \"alex@example.com\""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM list response containing the requested user resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimUsersListResponseDto"
                },
                "example": {
                  "schemas": [
                    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
                  ],
                  "totalResults": 1,
                  "startIndex": 1,
                  "itemsPerPage": 25,
                  "Resources": [
                    {
                      "schemas": [
                        "urn:ietf:params:scim:schemas:core:2.0:User",
                        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
                        "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User"
                      ],
                      "id": "ExampleUserId001",
                      "meta": {
                        "resourceType": "User",
                        "created": "2025-01-15T10:00:00.000Z",
                        "lastModified": "2025-01-15T10:00:00.000Z"
                      },
                      "userName": "alex@example.com",
                      "name": {
                        "formatted": "Alex Morgan",
                        "givenName": "Alex",
                        "familyName": "Morgan"
                      },
                      "addresses": [],
                      "active": true,
                      "emails": [
                        {
                          "type": "work",
                          "primary": true,
                          "value": "alex@example.com"
                        }
                      ],
                      "phoneNumbers": [],
                      "locale": "en",
                      "title": "Sales Manager",
                      "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                        "organization": "Example Company",
                        "division": "Commercial",
                        "department": "Sales"
                      },
                      "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User": {}
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request parameters are invalid."
          },
          "401": {
            "description": "The organization SCIM key is missing or invalid."
          }
        },
        "security": [
          {
            "scim-api-key": []
          }
        ]
      }
    },
    "/v1/scim/Users/{id}": {
      "get": {
        "operationId": "ScimUsersController_getUserById",
        "summary": "Get a user",
        "description": "Retrieve a provisioned user using the ID from the list response.",
        "tags": [
          "Users"
        ],
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Unique identifier of the Users resource",
            "schema": {
              "type": "string",
              "example": "ExampleUserId001"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requested SCIM Users resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimUsersResponseDto"
                },
                "example": {
                  "schemas": [
                    "urn:ietf:params:scim:schemas:core:2.0:User",
                    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
                    "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User"
                  ],
                  "id": "ExampleUserId001",
                  "meta": {
                    "resourceType": "User",
                    "created": "2025-01-15T10:00:00.000Z",
                    "lastModified": "2025-01-15T10:00:00.000Z"
                  },
                  "userName": "alex@example.com",
                  "name": {
                    "formatted": "Alex Morgan",
                    "givenName": "Alex",
                    "familyName": "Morgan"
                  },
                  "addresses": [],
                  "active": true,
                  "emails": [
                    {
                      "type": "work",
                      "primary": true,
                      "value": "alex@example.com"
                    }
                  ],
                  "phoneNumbers": [],
                  "locale": "en",
                  "title": "Sales Manager",
                  "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                    "organization": "Example Company",
                    "division": "Commercial",
                    "department": "Sales"
                  },
                  "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User": {}
                }
              }
            }
          },
          "401": {
            "description": "The organization SCIM key is missing or invalid."
          }
        },
        "security": [
          {
            "scim-api-key": []
          }
        ]
      }
    },
    "/v1/scim/Groups": {
      "get": {
        "operationId": "ScimGroupsController_getGroups",
        "summary": "List groups",
        "description": "List provisioned groups in your organization. Pass excludedAttributes=members when you only need group metadata.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "startIndex",
            "required": false,
            "in": "query",
            "description": "The 1-based index of the first query result.",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "count",
            "required": false,
            "in": "query",
            "description": "Non-negative integer. Specifies the desired maximum number of query results per page.",
            "schema": {
              "maximum": 150,
              "default": 25,
              "type": "number"
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Return matching resources. The supported operators are eq and and.",
            "schema": {
              "type": "string",
              "example": "displayName eq \"Sales\""
            }
          },
          {
            "name": "excludedAttributes",
            "required": false,
            "in": "query",
            "description": "Pass members to omit membership details from the group response.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "example": [
                "members"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM list response containing the requested group resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimGroupsListResponseDto"
                },
                "example": {
                  "schemas": [
                    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
                  ],
                  "totalResults": 1,
                  "startIndex": 1,
                  "itemsPerPage": 25,
                  "Resources": [
                    {
                      "schemas": [
                        "urn:ietf:params:scim:schemas:core:2.0:Group"
                      ],
                      "id": "00000000-0000-4000-8000-000000000001",
                      "meta": {
                        "resourceType": "Group",
                        "created": "2025-01-15T10:00:00.000Z",
                        "lastModified": "2025-01-15T10:00:00.000Z"
                      },
                      "displayName": "Sales",
                      "members": [],
                      "externalId": "example-idp-group"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request parameters are invalid."
          },
          "401": {
            "description": "The organization SCIM key is missing or invalid."
          }
        },
        "security": [
          {
            "scim-api-key": []
          }
        ]
      }
    },
    "/v1/scim/Groups/{id}": {
      "get": {
        "operationId": "ScimGroupsController_getGroup",
        "summary": "Get a group",
        "description": "Retrieve a provisioned group using the ID from the list response.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Unique identifier of the Group resource",
            "schema": {
              "type": "string",
              "example": "00000000-0000-4000-8000-000000000001"
            }
          },
          {
            "name": "excludedAttributes",
            "required": false,
            "in": "query",
            "description": "Pass members to omit membership details from the group response.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "example": [
                "members"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requested SCIM Groups resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimGroupResponseDto"
                },
                "example": {
                  "schemas": [
                    "urn:ietf:params:scim:schemas:core:2.0:Group"
                  ],
                  "id": "00000000-0000-4000-8000-000000000001",
                  "meta": {
                    "resourceType": "Group",
                    "created": "2025-01-15T10:00:00.000Z",
                    "lastModified": "2025-01-15T10:00:00.000Z"
                  },
                  "displayName": "Sales",
                  "members": [],
                  "externalId": "example-idp-group"
                }
              }
            }
          },
          "401": {
            "description": "The organization SCIM key is missing or invalid."
          }
        },
        "security": [
          {
            "scim-api-key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ScimUsersListResponseDto": {
        "type": "object",
        "properties": {
          "schemas": {
            "description": "Definition of the contents of SCIM resource type. As defined by their URI.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalResults": {
            "type": "number",
            "description": "Specifies the total number of results matching the client query"
          },
          "startIndex": {
            "type": "number",
            "description": "The 1-based index of the first result in the current set of query results."
          },
          "itemsPerPage": {
            "type": "number",
            "description": "Specifies the number of query results returned in a query response page.",
            "default": 25
          },
          "Resources": {
            "description": "Array containing the user resources matching the client query.",
            "nullable": false,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimUsersResponseDto"
            }
          }
        },
        "required": [
          "schemas",
          "totalResults",
          "startIndex",
          "itemsPerPage",
          "Resources"
        ],
        "title": "SCIM Users List Response"
      },
      "ScimUsersResponseDto": {
        "type": "object",
        "properties": {
          "schemas": {
            "description": "Definition of the contents of SCIM resource type. As defined by their URI.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the resource."
          },
          "meta": {
            "description": "A complex attribute containing resource metadata.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScimMetaDto"
              }
            ]
          },
          "userName": {
            "type": "string",
            "description": "Unique identifier of the user at snapADDY. Refers to the user's email address."
          },
          "externalId": {
            "type": "string",
            "description": "Unique identifier of the user at snapADDY. Refers to the user's email address."
          },
          "name": {
            "description": "The name of the requested User.",
            "externalDocs": {
              "description": "See definition in section 4.1.1. of RFC 7643",
              "url": "https://datatracker.ietf.org/doc/html/rfc7643#section-4.1.1"
            },
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScimUsersNameResponseDto"
              }
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/ScimUsersNameResponseDto"
              }
            ]
          },
          "addresses": {
            "description": "A physical mailing address for this user.",
            "externalDocs": {
              "description": "See definition in section 4.1.2. of RFC 7643",
              "url": "https://datatracker.ietf.org/doc/html/rfc7643#section-4.1.2"
            },
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimAddressesResponseDto"
            }
          },
          "active": {
            "type": "boolean",
            "description": "Administrative status of the user. If this is true the user is is able to log in to snapADDY otherwise the user is soft-deleted, thus unable to log in.",
            "default": true
          },
          "emails": {
            "description": "Email addresses for the User.",
            "externalDocs": {
              "description": "See definition in section 4.1.2. of RFC 7643",
              "url": "https://datatracker.ietf.org/doc/html/rfc7643#section-4.1.2"
            },
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimEmailsResponseDto"
            }
          },
          "phoneNumbers": {
            "description": "Phone numbers for the User.",
            "externalDocs": {
              "description": "See definition in section 4.1.2. of RFC 7643",
              "url": "https://datatracker.ietf.org/doc/html/rfc7643#section-4.1.2"
            },
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimPhoneNumbersResponseDto"
            }
          },
          "locale": {
            "type": "string",
            "description": "Locale preferences for the user.",
            "default": "en"
          },
          "title": {
            "type": "string",
            "description": "The user's title, such as \"Vice President\"."
          },
          "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
            "description": "Defines attributes commonly used in representing users that belong to, or act on behalf of, a business or enterprise",
            "externalDocs": {
              "description": "See definition in section 4.3. of RFC 7643",
              "url": "https://datatracker.ietf.org/doc/html/rfc7643#section-4.3"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/ScimEnterpriseUserExtensionResponseDto"
              }
            ]
          },
          "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User": {
            "description": "Defines custom (customers' requested) attributes for Snapaddy users.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScimSnapaddyUserExtensionDto"
              }
            ]
          }
        },
        "required": [
          "schemas",
          "id",
          "meta",
          "userName",
          "name",
          "addresses",
          "active",
          "emails",
          "phoneNumbers",
          "locale",
          "title",
          "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
          "urn:ietf:params:scim:schemas:extension:snapaddy:2.0:User"
        ],
        "title": "SCIM Users Response"
      },
      "ScimMetaDto": {
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "description": "The name of the resource type of the resource.",
            "default": "User"
          },
          "created": {
            "format": "date-time",
            "type": "string",
            "description": "The DateTime that the resource was added to the service."
          },
          "lastModified": {
            "format": "date-time",
            "type": "string",
            "description": "The most recent DateTime that the details of this resource were updated."
          },
          "location": {
            "type": "string",
            "description": "The URI of the resource being returned."
          }
        },
        "required": [
          "resourceType",
          "created",
          "lastModified"
        ],
        "title": "SCIM Meta"
      },
      "ScimUsersNameResponseDto": {
        "type": "object",
        "properties": {
          "formatted": {
            "type": "string",
            "description": "The full name, including all middle names, titles, and suffixes as appropriate, formatted for display."
          },
          "familyName": {
            "type": "string",
            "description": "The family name of the User, or \"Last Name\" in most Western languages."
          },
          "givenName": {
            "type": "string",
            "description": "The given name of the User, or \"First Name\" in most Western languages."
          },
          "honorificPrefix": {
            "type": "string",
            "description": "The honorific prefix(es) of the User, or \"Title\" in most Western languages."
          },
          "honorificSuffix": {
            "type": "string",
            "description": "The honorific suffix(es) of the User, or \"Suffix\" in most Western languages."
          }
        },
        "required": [
          "formatted",
          "familyName",
          "givenName"
        ],
        "title": "SCIM Users Name Response"
      },
      "ScimAddressesResponseDto": {
        "type": "object",
        "properties": {
          "streetAddress": {
            "type": "string",
            "description": "The full street address component, which may include house number, street name, P.O. box, and multi-line extended street address information. This attribute MAY contain newlines."
          },
          "locality": {
            "type": "string",
            "description": "The city or locality."
          },
          "region": {
            "type": "string",
            "description": "The state or region."
          },
          "postalCode": {
            "type": "string",
            "description": "The postal code."
          },
          "country": {
            "type": "string",
            "description": "The country name component. When specified, the value MUST be in ISO 3166-1 \"alpha-2\" code format [ISO3166]; e.g., the United States and Sweden are \"US\" and \"SE\", respectively."
          },
          "type": {
            "type": "string",
            "description": "Type of the address. Can be work, home, etc."
          }
        },
        "required": [
          "streetAddress",
          "locality",
          "region",
          "postalCode",
          "country",
          "type"
        ],
        "title": "SCIM Addresses Response"
      },
      "ScimEmailsResponseDto": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Email address of the user."
          },
          "type": {
            "type": "string",
            "description": "Type of the email address. Note that this will always be <i>work</i> because we do not support multiple email addresses."
          },
          "primary": {
            "type": "boolean",
            "description": "Primary indictator for the email address. Note that this will always be true because we do not support multiple email addresses."
          }
        },
        "required": [
          "value",
          "type",
          "primary"
        ],
        "title": "SCIM Emails Response"
      },
      "ScimPhoneNumbersResponseDto": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Phone number of the user."
          },
          "type": {
            "type": "string",
            "description": "Type of the phone number. Note that this will always be <i>work</i> because we do not support multiple phone numbers."
          },
          "primary": {
            "type": "boolean",
            "description": "Primary indicator for the phone number. Note that this will always be true because we do not support multiple phone numbers."
          }
        },
        "required": [
          "value",
          "type",
          "primary"
        ],
        "title": "SCIM Phone Numbers Response"
      },
      "ScimEnterpriseUserExtensionResponseDto": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "string",
            "description": "Organization name of the user."
          },
          "division": {
            "type": "string",
            "description": "The division of the user."
          },
          "department": {
            "type": "string",
            "description": "The department of the user."
          }
        },
        "required": [
          "organization",
          "division",
          "department"
        ],
        "title": "SCIM Enterprise User Extension Response"
      },
      "ScimSnapaddyUserExtensionDto": {
        "type": "object",
        "properties": {
          "academicTitle": {
            "type": "string",
            "description": "The academic title of the user.",
            "nullable": true
          },
          "customTags": {
            "type": "string",
            "description": "Custom tags (accreditations) of the user. Separate tags with a semicolon.",
            "nullable": true
          },
          "infoHeading": {
            "type": "string",
            "description": "The info heading of the user.",
            "nullable": true
          },
          "infoContent": {
            "type": "string",
            "description": "The info content of the user.",
            "nullable": true
          }
        },
        "title": "SCIM Snapaddy User Extension"
      },
      "ScimGroupsListResponseDto": {
        "type": "object",
        "properties": {
          "schemas": {
            "description": "Definition of the contents of SCIM resource type. As defined by their URI.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalResults": {
            "type": "number",
            "description": "Specifies the total number of results matching the client query"
          },
          "startIndex": {
            "type": "number",
            "description": "The 1-based index of the first result in the current set of query results."
          },
          "itemsPerPage": {
            "type": "number",
            "description": "Specifies the number of query results returned in a query response page.",
            "default": 25
          },
          "Resources": {
            "description": "Array containing the group resources matching the client query.",
            "nullable": false,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimGroupResponseDto"
            }
          }
        },
        "required": [
          "schemas",
          "totalResults",
          "startIndex",
          "itemsPerPage",
          "Resources"
        ],
        "title": "SCIM Groups List Response"
      },
      "ScimGroupResponseDto": {
        "type": "object",
        "properties": {
          "schemas": {
            "description": "Definition of the contents of SCIM resource type. As defined by their URI.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "description": "The unique identifier of the SCIM resource as defined by the service provider.",
            "nullable": false
          },
          "meta": {
            "description": "A complex attribute containing resource metadata.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScimMetaDto"
              }
            ]
          },
          "displayName": {
            "type": "string",
            "description": "The name of the group.",
            "nullable": false
          },
          "members": {
            "description": "The members of the group.",
            "nullable": false,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScimResourceStringValueDto"
            }
          },
          "externalId": {
            "type": "string",
            "description": "The external ID of the group.",
            "nullable": false
          }
        },
        "required": [
          "schemas",
          "id",
          "meta",
          "displayName",
          "members",
          "externalId"
        ],
        "title": "SCIM Group Response"
      },
      "ScimResourceStringValueDto": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "String attribute value.",
            "nullable": false
          }
        },
        "title": "SCIM Resource String Value"
      }
    },
    "securitySchemes": {
      "scim-api-key": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use an [organization SCIM key](https://portal.snapaddy.com/knowledge/configure-scim-user-provisioning)."
      }
    }
  }
}
