API

RoderWorkspaceCredential

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/agent/roder/workspace_credentials create Short-lived repository clone and user API credentials

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

created, err := client.RoderWorkspaceCredential(nil).Create(map[string]any{"required_lifetime_seconds": 1}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local created, err = client:RoderWorkspaceCredential():create({ required_lifetime_seconds = 1 })

PHP

Construct client as shown in the PHP setup, then call the operations:

$created = $client->RoderWorkspaceCredential()->create(["required_lifetime_seconds" => 1]);

Python

Construct client as shown in the Python setup, then call the operations:

created = client.RoderWorkspaceCredential().create({ "required_lifetime_seconds": 1 })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

created = client.RoderWorkspaceCredential.create({ "required_lifetime_seconds" => 1 })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const created = await client.RoderWorkspaceCredential().create({ required_lifetime_seconds: 1 })

Fields

Field Type Required Description
api_token string Yes Short-lived personal access token for the spawning user.
author_email string Yes Author Email
author_name string Yes Author Name
clone_url string Yes Clone Url
default_branch string Yes Default Branch
expires_at string Yes Expires At
organization_id string Yes Organization Id
repository_id string Yes Repository Id
repository_slug string Yes Repository Slug
repository_spec string Yes The explicitly selected physical repository address.
required_lifetime_seconds integer Yes Lifetime the pending clone or command must be able to complete within.
token string Yes Short-lived read/write repository credential.
username string Yes Username

create

POST /api/v1/agent/roder/workspace_credentials

Operation ID: api_v1_roder_workspace_credentials.

Authentication: bearer token (bearerAuth).

Request body

application/json

Property Type Required Description
required_lifetime_seconds integer Yes Lifetime the pending clone or command must be able to complete within.

Responses

200: Short-lived repository clone and user API credentials

application/json

Property Type Required Description
api_token string (password) Yes Short-lived personal access token for the spawning user. Installed into the sandbox CLI config so vex and API clients act as that user. The raw value is returned once and only its digest is stored.
author_email string (email) Yes
author_name string Yes
clone_url string (uri) Yes
default_branch string Yes
expires_at string (date-time) Yes
organization_id string Yes
repository_id string Yes
repository_slug string Yes
repository_spec string Yes The explicitly selected physical repository address.
token string (password) Yes Short-lived read/write repository credential. The raw value is returned once and only its digest is stored.
username enum: vex Yes
400: Required credential lifetime is missing or invalid

application/json

Property Type Required Description
error string Yes
401: Invalid, expired, or unauthorized agent capability

application/json

Property Type Required Description
error string Yes
503: Agent repository access is not configured

application/json

Property Type Required Description
error string Yes