---
title: "Send an HTTPS request with a stored API key, without seeing the key"
method: POST
path: "/v1/org/secrets/{secretId}/http-request"
tags: ["Secrets"]
---

# Send an HTTPS request with a stored API key, without seeing the key

`POST /v1/org/secrets/{secretId}/http-request`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/org/secrets/{secretId}/http-request`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Calls a service with an API key stored in the organization's secrets. Name the secret in the path (see the list of secrets shared with you), and give the method, the https address on that key's service, and optional headers and body. OpenWork Cloud adds the key, sends the request without following redirects, and returns the status, a few headers and the body, with the key replaced wherever it appears. The key is never returned. The address must be on the key's exact host. An agent cannot approve the use itself: when the answer is approval_required, tell the person that the secret needs their rule set to always (openwork secrets my-rule <name> --rule always) or an admin to allow it, and do not retry until they have. Every refusal and every use is recorded for the organization.

## Path parameters

- `secretId` string, required

## Request body

- BrokerHttpWithOrganizationSecretRequest
  - `url` string, required
  - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', required
  - `headers` object
  - `body` string
  - `agentId` string, typeid: Den TypeID with 'pga_' prefix and a 26-character base32 suffix.
  - `client` 'cli' | 'desktop'
  - `approval` 'once' | 'always'

## Response `200`

The response, with the key replaced.

- BrokerHttpWithOrganizationSecretResponse
  - `status` integer, required
  - `headers` object, required
  - `body` string, required
  - `truncated` boolean, required

## Other responses

- `400`: Invalid request or machine caller attempted to write a secret.
- `401`: Sign-in required.
- `403`: Missing permission, recent sign-in, or blind-use authorization.
- `404`: Organization secrets are off or resource not found.
- `409`: The secret is not an API key, or it cannot be decrypted here.
- `502`: The service could not be reached, or answered with a redirect.

## Changes

- **2026-12-03** `f64701c14c83`: 1 info
  - api operation id `brokerHttpRequestWithOrganizationSecret` removed and replaced with `sendRequestWithOrganizationSecret`
- **2026-12-03** `b433928052b7`: 1 warning, 3 info
  - removed the request property `surface`
  - added the new optional request property `client`
  - added the non-success response with the status `502`
  - added the required property `truncated` to the response with the `200` status
- **2026-12-02** `1c1cd9580c18`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/secrets/:secretId/http-request/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
