> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/scim/rotate-the-token-of-a-scim-connection.md).

# Rotate the token of a SCIM connection

Replaces the token of a SCIM connection. The previous token stops working immediately, and the new token is only returned in this response.

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"scim","description":"Connect an identity provider such as Okta or Microsoft Entra ID to provision your organization's members with SCIM.\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user-internal":[]}],"components":{"securitySchemes":{"user-internal":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"scimConnectionId":{"name":"scimConnectionId","in":"path","required":true,"description":"The unique id of the SCIM connection","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"OrganizationSCIMConnectionWithToken":{"description":"A SCIM connection with its token, returned only when the token is created.","allOf":[{"$ref":"#/components/schemas/OrganizationSCIMConnection"},{"type":"object","properties":{"token":{"type":"string","description":"Bearer token to configure in the identity provider. It can't be retrieved again."}},"required":["token"]}]},"OrganizationSCIMConnection":{"type":"object","description":"A SCIM connection through which an identity provider provisions organization members.","properties":{"object":{"type":"string","description":"The object type, which is always \"scim-connection\"","enum":["scim-connection"]},"id":{"type":"string","description":"Unique identifier of the SCIM connection"},"label":{"$ref":"#/components/schemas/SCIMConnectionLabel"},"provider":{"$ref":"#/components/schemas/SCIMConnectionProvider"},"baseURL":{"description":"SCIM base URL to configure in the identity provider","$ref":"#/components/schemas/URL"},"tokenHint":{"type":"string","description":"Last characters of the current token, to identify it"},"tokenCreatedAt":{"description":"Date the current token was created","$ref":"#/components/schemas/Timestamp"},"lastUsedAt":{"description":"Date of the last request authenticated with the token","$ref":"#/components/schemas/Timestamp"},"createdAt":{"description":"Date of creation","$ref":"#/components/schemas/Timestamp"},"updatedAt":{"description":"Date of the last update","$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"description":"URL of the SCIM connection in the API","$ref":"#/components/schemas/URL"}},"required":["location"]}},"required":["object","id","label","provider","baseURL","tokenHint","tokenCreatedAt","createdAt","updatedAt","urls"]},"SCIMConnectionLabel":{"type":"string","description":"Name of the SCIM connection, shown to organization admins.","minLength":1,"maxLength":100},"SCIMConnectionProvider":{"type":"string","description":"Identity provider that provisions members through the SCIM connection.","enum":["okta","entra","generic"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Timestamp":{"type":"string","format":"date-time"}},"responses":{"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"paths":{"/orgs/{organizationId}/scim/connections/{scimConnectionId}/token":{"post":{"operationId":"rotateOrganizationSCIMConnectionToken","summary":"Rotate the token of a SCIM connection","description":"Replaces the token of a SCIM connection. The previous token stops working immediately, and the new token is only returned in this response.\n","tags":["scim"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/scimConnectionId"}],"responses":{"200":{"description":"Token rotated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationSCIMConnectionWithToken"}}}},"404":{"$ref":"#/components/responses/NotFoundError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/scim/rotate-the-token-of-a-scim-connection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
