---
title: "Replace session credential assignments"
method: PUT
path: "/api/projects/{projectId}/sessions/{sessionId}/credentials"
tags: ["Credentials"]
---

# Replace session credential assignments

`PUT /api/projects/{projectId}/sessions/{sessionId}/credentials`

Replace session credential assignments. Replaces the target resource or assignment with the supplied JSON representation.

## Path parameters

- `projectId` string, required
- `sessionId` string, required

## Request body

- SetSessionCredentialAssignmentsRequest — set Session Credential Assignments Request payload accepted by the API.
  - `credentials` SessionCredentialAssignment[], required — Collection of credential values.
    - `credentialId` string, required — Credential identifier.
    - `agentVisible` boolean — agent Visible value for the session Credential Assignment object.
    - `visibility` CredentialVisibility — credential Visibility API object.
      - `tools` boolean, required — Collection of tool values.
      - `console` boolean, required — console value for the credential Visibility object.
      - `services` boolean, required — Collection of service values.
      - `hooks` boolean, required — Collection of hook values.

## Response `200`

Assignments

- SessionCredentialAssignmentsResponse — session Credential Assignments Response payload returned by the API.
  - `credentials` SessionCredentialAssignment[], required — Collection of credential values.
    - `credentialId` string, required — Credential identifier.
    - `agentVisible` boolean — agent Visible value for the session Credential Assignment object.
    - `visibility` CredentialVisibility — credential Visibility API object.
      - `tools` boolean, required — Collection of tool values.
      - `console` boolean, required — console value for the credential Visibility object.
      - `services` boolean, required — Collection of service values.
      - `hooks` boolean, required — Collection of hook values.

## Changes

> 11 revisions in range; 1 could not be searched.

- **2026-06-01** `90fa68eb439c` — 7 breaking, 4 warning, 1 info
  - added `#/components/schemas/CredentialVisibility` to the `credentials/items/visibility` request property `allOf` list
  - the `credentials/items/visibility` request property type/format changed from `object`/`` to ``/``
  - the `credentials/items/visibility` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `credentials/items/visibility/console` from the response with the `200` status
  - …8 more
- **2026-05-29** `2d34481e85d7` — 6 breaking, 1 warning, 5 info
  - added the new required request property `credentials/items/visibility/console`
  - added the new required request property `credentials/items/visibility/hooks`
  - added the new required request property `credentials/items/visibility/services`
  - added the new required request property `credentials/items/visibility/tools`
  - …8 more

[Change history](https://skmtc.dev/ibuildthecloud/apis/discobot-server-api/changes/api/projects/:projectId/sessions/:sessionId/credentials/put.md)

---

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