Skip to main content
PUT
Upload tokens to a server account

Authorizations

Authorization
string
header
required

MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.

Path Parameters

projectId
string
required

ID of the hosted project that contains the server.

serverId
string
required

ID of the server inside the project.

account
string
required

The account's id, or its name. A well-formed account id is matched as an id; anything else is a name, matched ignoring case.

Body

application/json

Tokens and the OAuth client they were issued to, and nothing else. A URL field (serverUrl, authorizationServerUrl, oauthResourceUrl) or tokens.id_token answers 400 with details.code: "field_not_accepted"; any other unknown field answers 400.

tokens
object
required
clientInformation
object
required

Response

The token was replaced; the account keeps its id.

One account a saved server signs in with. METADATA ONLY: no account response carries a token, a vault id, an email or any other recorded profile field.

id
string
required

Never changes, including while the account needs reconnecting. An eval suite's saved account choice stores it.

name
string | null
required

Your own label, or null for an account nobody named. Nothing checks it against who the token belongs to.

kind
enum<string>
required

project accounts belong to a server shared with the project; project admins manage them.

Available options:
personal,
project
isDefault
boolean
required

The effective default: the account marked as default, else the oldest. Runs with no saved account choice act as it.

needsReconnect
boolean
required

The issuer rejected a refresh, or the token expired with no refresh token stored. Upload a fresh token to restore it; the id stays.

hostedOnly
boolean
required

Hosted runs use the account, and no local app, browser or sandbox receives its token. True for accounts written by PUT .../accounts/{account} and for project accounts.

expiresAt
integer | null
required

When the access token expires, epoch milliseconds.

createdAt
integer
required
updatedAt
integer
required