---
title: "Create a credential binding for a workspace"
method: POST
path: "/api/workspaces/{id}/credentials/{kind}"
tags: ["Misc"]
---

# Create a credential binding for a workspace

`POST /api/workspaces/{id}/credentials/{kind}`

On success returns 201 with the new binding. When the provider requires OIDC device code authentication returns 202 with verification_uri and user_code; poll device-complete to finalize.

## Path parameters

- `id` string, required
- `kind` string, required

## Request body

- CredentialBindingCreateRequest
  - `config` string, required
  - `display_name` string, required

## Response `201`

Binding created

- CredentialBindingCreateResponse
  - `auth_type` string
  - `display_name` string
  - `expires_in` integer
  - `id` string, required
  - `is_default` boolean
  - `server_url` string
  - `status` string
  - `user_code` string
  - `verification_uri` string

## Other responses

- `202` — OIDC device code flow initiated
- `400` — bad request
- `401` — unauthorized
- `409` — duplicate display_name
- `500` — internal error

---

[API](https://skmtc.dev/agentserver/apis/agentserver-api.md) · [All operations](https://skmtc.dev/agentserver/apis/agentserver-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agentserver/agentserver-api/revisions/e8c329825b4e/schema)
