---
title: "POST /projects/{project_id}/sandboxes/{sandbox_id}/services"
method: POST
path: "/projects/{project_id}/sandboxes/{sandbox_id}/services"
tags: ["Sandbox services"]
---

# POST /projects/{project_id}/sandboxes/{sandbox_id}/services

`POST /projects/{project_id}/sandboxes/{sandbox_id}/services`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/sandboxes/{sandbox_id}/services`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `sandbox_id` string, required

## Request body

- RequestSandboxService
  - `service_id` string, required
  - `service_version` integer, required

## Response `202`

Service access state; inspect enforcement for worker acknowledgment

- SandboxServiceResponse
  - `connected` boolean, required
  - `created_at` string, date-time, required
  - `enforcement` 'not_requested' | 'pending' | 'active' | 'stopping' | 'stopped', required: Observed worker enforcement, independent of the requested authorization.
  - `expires_at` string, date-time, nullable
  - `id` string, required
  - `policy` SandboxAccessPolicy, required: Exact destination and request scope. The broker must validate this again against its supported protocols before installing a policy.
    - `delivery` CredentialDelivery, nullable: How a stored credential is presented to the destination, plus any fixed headers the API requires. Changing it changes the policy, so consent given for the previous delivery does not carry over.
      - `format` union: The credential is one stored secret. Formats differ only in how it is sent.
        - object: `Authorization: Bearer <credential>`.
          - `method` 'bearer', required
        - object: `<name>: <prefix><credential>`, for example `x-api-key`.
          - `method` 'header', required
          - `name` string, required
          - `prefix` string, nullable
        - object: `Authorization: Basic base64(<username>:<credential>)` with a fixed username.
          - `method` 'basic_token', required
          - `username` string, required
        - object: `Authorization: Basic base64(<credential>)`; the stored credential is `username:password`.
          - `method` 'basic', required
      - `headers` RequestHeader[]: Fixed, non-secret headers sent with every request, such as an API version. At most 16; values are printable ASCII and never templates.
        - `name` string, required
        - `value` string, required
    - `github_repository` GithubRepositoryAccess, nullable: Immutable reference to an explicitly selected GitHub connection and synced repository. Changing the connection or repository requires a new policy and fresh consent.
      - `connection_id` integer, required
      - `owner` string, required
      - `protocol` 'api' | 'git', required
      - `repository` string, required
    - `methods` AccessMethod[], required
    - `origin` string, required: HTTPS origin only; no path, userinfo, query, fragment or non-443 port.
    - `path_prefixes` string[], required: Segment-boundary path prefixes, for example `/owner/private-repo`.
    - `provider` 'github' | 'gitlab' | 'openai' | 'anthropic' | 'stripe' | 'resend' | 'sendgrid' | 'vercel' | 'netlify' | 'mistral' | 'groq', nullable
  - `reason` string, required
  - `service_id` string, required
  - `service_name` string, required
  - `service_version` integer, required
  - `status` 'pending_approval' | 'approved' | 'suspended' | 'revoked' | 'expired' | 'policy_changed' | 'service_disabled', required
  - `version` integer, required

## Other responses

- `400`: Invalid access request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Scoped resource not found
- `409`: Policy or approval changed
- `500`: Storage failed

## Changes

- **2026-11-14** `3d5be996525d`: 1 info
  - added the optional property `policy/delivery` to the response with the `202` status
- **2026-11-14** `101ef74660bc`: 1 warning
  - removed the optional property `policy/delivery` from the response with the `202` status
- **2026-11-13** `9093c4f2c4cd`: 1 info
  - added the optional property `policy/delivery` to the response with the `202` status
- **2026-11-10** `25defd2aafb8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/sandboxes/:sandbox_id/services/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
