# Make or rotate the SCIM token

> Page: https://docs.plotwork.dev/api/post-orgs-org-scim-token. Index of every page: https://docs.plotwork.dev/llms.txt

Makes a bearer token for the identity provider, shown once and stored only as a hash.

`POST /orgs/{org}/scim/token`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Make or rotate the SCIM token. |
| What does it take? | `org` in the path. |
| What does it return? | Status 201 with a body of type [`ScimTokenIssued`](https://docs.plotwork.dev/api/schemas.md#scimtokenissued). |
| What can go wrong? | `401` not signed in; `403` a member or a reader (orgs.forbidden), a plan without scim (plan.sso_not_included), or the request came from an origin that may not make changes; `404` no such organisation, or the caller is not a member of it; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

Makes a bearer token for the identity provider, shown once and stored only as a hash. A live token is revoked at the same moment. Enterprise; the owner and admins.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 201 | The token, shown once. | [`ScimTokenIssued`](https://docs.plotwork.dev/api/schemas.md#scimtokenissued) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | A member or a reader (orgs.forbidden), a plan without SCIM (plan.sso_not_included), or the request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation, or the caller is not a member of it. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 201 answer has the type [`ScimTokenIssued`](https://docs.plotwork.dev/api/schemas.md#scimtokenissued).

| Field | Type | Required | Description |
|---|---|---|---|
| `token` | `string` | yes | The bearer token for the identity provider. Shown once; only its hash is kept. |
| `view` | `ScimTokenView` | yes |  |
| `view.prefix` | `string` | yes | The first characters of the token, to tell it apart. |
| `view.createdAt` | `integer` | yes |  |
| `view.lastUsedAt` | `integer \| null` | yes | When the provider last used it, to the minute. Null until it has. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
