Rotate a repository resource credential.
POST /api/v1/cloud/sessions/{session_id}/resources/{resource_id}
Updates credentials for github_repository and git_repository resources.
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | Session ID with the sess_ prefix |
resource_id | string | Resource ID with the sesr_ prefix |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $QODER_ACCESS_TOKEN |
Content-Type | Yes | application/json |
{"password":"new-password-or-token"}. Its repository URL must already include a username. Do not send conflicting credential fields. Credentials are write-only.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
authorization_token | string | For GitHub | New GitHub Access Token; also accepted for legacy generic Git clients |
password | string | For generic Git | Password or Access Token; surrounding spaces are preserved |
Example request
Example response
HTTP 200 OK
Returns the updated Session resource. The token is not returned.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Resource is not a repository, credentials conflict, or malformed request |
| 401 | authentication_error | PAT or SAT invalid or expired |
| 404 | not_found_error | Session or resource does not exist |

