Skip to main content

List Machine Clients

Retrieves a list of all machine clients within an organization. For security, secrets are never returned in list responses.
GET /v1/organizations/:orgId/machine-clients

Path Parameters

ParameterTypeRequiredDescription
orgIdstringRequiredOrganization ID (prefix: org_)

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Maximum items to return (max 100)
offsetinteger0Number of items to skip
dockIdstring-Filter by dock
isActiveboolean-Filter by active status

Example Request

# List all machine clients
curl https://api.docyard.io/v1/organizations/org_01HQ3K.../machine-clients \
  -H "Authorization: Bearer dk_live_a1b2c3d4..."

# Filter by dock
curl "https://api.docyard.io/v1/organizations/org_01HQ3K.../machine-clients?dockId=dock_metro_general" \
  -H "Authorization: Bearer dk_live_a1b2c3d4..."

# Show only active clients
curl "https://api.docyard.io/v1/organizations/org_01HQ3K.../machine-clients?isActive=true" \
  -H "Authorization: Bearer dk_live_a1b2c3d4..."

Response

{
  "data": [
    {
      "id": "mc_01HQ3K9B2...",
      "clientId": "dyc_epic_prod_a1b2c3d4",
      "name": "epic-ehr-integration",
      "scopes": ["artifacts:write", "artifacts:read"],
      "dockId": "dock_metro_general",
      "organizationId": "org_01HQ3K...",
      "partyId": "pty_metro_health",
      "isActive": true,
      "createdAt": "2024-03-01T12:00:00.000Z"
    },
    {
      "id": "mc_01HQ3L9C3...",
      "clientId": "dyc_github_actions_xyz789",
      "name": "github-actions-pipeline",
      "scopes": ["artifacts:write"],
      "dockId": "dock_build_artifacts",
      "organizationId": "org_01HQ3K...",
      "partyId": null,
      "isActive": true,
      "createdAt": "2024-02-15T09:30:00.000Z"
    }
  ],
  "meta": {
    "total": 5,
    "page": 1,
    "pageSize": 20,
    "hasMore": false
  }
}

Response Fields

FieldTypeDescription
dataarrayList of machine clients
data[].idstringClient identifier (prefix: mc_)
data[].clientIdstringOAuth2 client ID (prefix: dyc_)
data[].namestringHuman-readable identifier
data[].scopesarrayGranted permission scopes
data[].dockIdstringRestricted dock (null if org-wide)
data[].organizationIdstringParent organization
data[].partyIdstringLinked party for audit trails
data[].isActivebooleanActivation status
data[].createdAtstringISO 8601 timestamp
meta.totalintegerTotal machine clients
meta.hasMorebooleanWhether more results exist
Security Note: Client secrets (dys_...) are never returned in list or get responses. They are shown only once during creation. If a secret is lost, you must rotate it.

Error Handling

StatusCondition
401Missing or invalid API key
404Organization not found

Use Cases

Security Audit: Review all automated integrations and their permission scopes. Compliance Review: Identify which systems have access to which docks. Client Management: Deactivate unused clients by setting isActive: false.

Managing Client Access

To revoke a machine client’s access:
  1. Update isActive to false (soft delete)
  2. Or rotate the secret to invalidate existing tokens
# Deactivate a client
curl -X PATCH https://api.docyard.io/v1/organizations/{orgId}/machine-clients/{clientId} \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{"isActive": false}'