---
title: "Set user credential token"
method: PUT
path: "/v1/projects/{project_id}/user-credentials/{credential_id}/users"
tags: ["user-credentials"]
---

# Set user credential token

`PUT /v1/projects/{project_id}/user-credentials/{credential_id}/users`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/user-credentials/{credential_id}/users`
- Auth: HTTP bearer

Stores an end user's API token for a `token` credential, replacing any token stored before.

MCP servers that use the credential send it as `Authorization: Bearer` in runs for this
user, and tools read it with `user_credential`. The token is stored encrypted and never returned.

Required permission: `oauth_apps.connect`.

## Path parameters

- `project_id` string, uuid, required
- `credential_id` string, uuid, required

## Request body

- CredentialTokenSet: API token to store for an end user.
  - `user_id` string, required: Your ID for the end user, up to 255 characters. Use the value your middleware sets at the context path named by `credential.user`.
  - `token` string, required: The end user's API token. It is stored encrypted and never returned.
  - `expires_at` string, date-time, nullable: When the token stops working. After it, MCP servers skip the user and tools get no token. Omit for no expiry.

## Response `200`

Successful Response

- CredentialUserResponse: End user's connection to a user credential.
  - `user_id` string, required: End-user ID your backend passed when setting the token or creating the connect link.
  - `status` 'connected' | 'expired', required: `expired` when the token has expired and no refresh token is stored, otherwise `connected`.
  - `scope` string, nullable, required: Scope the provider granted, or null if it didn't report one.
  - `expires_at` string, nullable, required: When the stored token expires, or null if it has no expiry.
  - `connected_at` string, required: When the end user last connected.
  - `last_used_at` string, nullable, required: When an agent run last used the token, or null if never.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

## Changes

- **2026-11-21** `93c92c49aafa`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/connic/apis/connic-api/changes/v1/projects/:project_id/user-credentials/:credential_id/users/put.md)

---

[API](https://skmtc.dev/connic/apis/connic-api.md) - [All operations](https://skmtc.dev/connic/apis/connic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/connic/apis/connic-api/revisions/da5f0d500a9d?raw)
