Skip to content
NewNexus 2.0 is here, and it’s open source. Read the launch post

API reference

Connectors

Connector reads and module writes with a standing Policy grant, shared by every module.

View as Markdown

Connectors

get/v1/connectors

The connectors Gateway offers, their operations, and whether each is usable by the caller. A connector reaches an outside service by name, such as linear, github, jira, slack or notion: issues and tickets, pull requests, messages, mail, calendars, docs and files. Check it before you say a named service is unavailable.

connectors.useEvery member, module keysTry it in the API Explorer

Responses

200OKapplication/json

  • connectorsarray of object
    • stage"preview" | "released"

      How far it is along its release: production offers only released connectors, a preview Gateway both

    • offeredboolean

      Whether this Gateway offers it. No one uses one it does not offer: a call answers 403 connector_not_offered

    • usableboolean | null

      Whether the organization made it available to the caller (GET /v1/policies/connectors); null when it could not be read; false for one this Gateway does not offer

    • connectsarray of "user" | "org"

      Whose connections it runs with: a person's own (user), the organization's (org); empty when it resolves its own credential. A call takes an optional account when it is not empty.

    • formobject | null

      The fields POST /v1/connections/{connector} takes, as a JSON Schema whose secret fields carry x-nexus-secret: true; null when it does not connect with a key

    • oauthboolean

      Whether it connects with OAuth on this gateway (POST /v1/connections/{connector}/oauth)

    • offline_inputobject

      Only on a gateway that reads this connector's offline test data (NEXUS_CONNECTORS=mock): the form's fields that test data accepts. POST them to /v1/connections/{connector} with the scope that connects admits: user or org. A secret field holds a placeholder, never a key. Absent when the connector calls its vendor.

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/connectors" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.connectors();

Describe connector

get/v1/connectors/{name}

One connector by its service's name (linear for Linear issues and tickets) and its operations, each with its effect (read or mutate) and its request schema, and whether the caller may use it (usable). It answers for every connector; readConnector and writeConnector run only one the organization made available to the caller. 404 when no connector has this name.

connectors.useEvery member, module keysTry it in the API Explorer

Parameters

  • namepath · stringrequired

    The connector, as GET /v1/connectors lists it (github, jira)

Responses

200OKapplication/json

  • namestring
  • descriptionstring
  • stage"preview" | "released"

    How far it is along its release: production offers only released connectors, a preview Gateway both

  • offeredboolean

    Whether this Gateway offers it. No one uses one it does not offer: a call answers 403 connector_not_offered

  • usableboolean | null

    Whether the organization made it available to the caller (GET /v1/policies/connectors); null when it could not be read; false for one this Gateway does not offer

  • connectsarray of "user" | "org"

    Whose connections it runs with: a person's own (user), the organization's (org); empty when it resolves its own credential. A call takes an optional account when it is not empty.

  • formobject | null

    The fields POST /v1/connections/{connector} takes, as a JSON Schema whose secret fields carry x-nexus-secret: true; null when it does not connect with a key

  • oauthboolean

    Whether it connects with OAuth on this gateway (POST /v1/connections/{connector}/oauth)

  • operationsarray of object
    • namestring
    • summarystring
    • effect"read" | "mutate"
    • requestobject

      The JSON schema of the operation's parameters.

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/connectors/Platform" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Write connector

post/v1/connectors/{name}/{operation}

Run one connector operation, a read or a change. A change runs only for a module holding a write grant for it (PUT /v1/policies/grants/{product}/{capability}); a person's change is refused with 403 write_not_granted until people get write scopes. A chat agent's link writes only with the approval record the person confirmed for exactly this call, named in x-nexus-approval, while the organization has chat writes on: else 403 write_not_granted (no record), approval_invalid or chat_writes_off. The record is used by the call, once. Every change attempt and every scoped read is audited as connector.write. github/pull_merge squash-merges only at expected_head_sha and only when branch protection allows it, never past it: 400 merge_method_refused, 409 head_changed, not_mergeable or pull_not_open. github/pull_edit and pull_reviewers change only an open pull request (409 pull_not_open), and GitHub's refusal of a reviewer is 422 reviewer_refused. github/pull_state closes or reopens and never merges: 409 pull_merged, 422 not_reopenable. github/pull_labels adds only a label the repository has: 404 label_unknown. A runner's change inside a native session names the session and its fencing token (x-nexus-cloud-session, x-nexus-fencing-token): 400 invalid_session_fence without both, 404 session_not_found for a session that is not yours, 409 session_ended for an ended one, and 409 lost_runner when another runner took the session; nothing is called, and the refusal is audited. A change that names no fence while its credential holds a native session's live runner lease is refused with 409 fence_required (error.nexus.session names the session) when the server requires the fence; nothing is called, and the refusal is audited. When the server asks for write scopes on demand (NEXUS_CONNECTOR_WRITE_CONSENT), a change on an OAuth connection that holds none of the connector's write scopes is refused with 403 write_consent_required; nothing is called. error.nexus names the connector, the account, the scopes the change needs, and the consent call that asks for them (POST /v1/connections/{connector}/oauth with access: write). A change sent with Idempotency-Key carries a hidden marker in the body it writes (github/issue_comment, pull_review, issue_create). When GitHub got the write but its answer was lost, the 502 says error.nexus.outcome: unknown and the key is kept: a retry with the same key reads the target for the marker, answers what it found as a replay, or writes once. A retry that cannot read the target is 502 reconciliation_failed and writes nothing. Send an Idempotency-Key with every change. While the Gateway enforces connector write keys (off by default), a change without one is 428 idempotency_key_required, and nothing is called. A read never needs one.

connectors.useEvery member, module keysTry it in the API Explorer

Parameters

  • namepath · stringrequired

    The connector, as GET /v1/connectors lists it (github, jira)

  • operationpath · stringrequired

    The operation, as GET /v1/connectors/{name} lists it

  • x-nexus-approvalheader · string

    A chat agent's confirmed approval record for this exact call (POST /v1/approvals)

  • x-nexus-cloud-sessionheader · string

    The native session (/v1/sessions) a runner's change is made inside, with x-nexus-fencing-token. Send both or neither.

  • x-nexus-fencing-tokenheader · string

    The fencing token the runner got when it took the session (POST /v1/sessions/{id}/runner). A change whose token is not the session's current one is refused with 409 lost_runner before the outside system is called, and audited as connector.write with outcome: denied.

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

object

Responses

200OKapplication/json

object

428Only while the Gateway enforces connector write keys (off by default): a change sent without `Idempotency-Key` (`idempotency_key_required`). Nothing was called.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400merge_method_refused400 `merge_method_refused`, 409 `head_changed`, `not_mergeable` or `pull_not_open`
400invalid_session_fence400 `invalid_session_fence` without both, 404 `session_not_found` for a session that is not yours, 409 `session_ended` for an ended one, and 409 `lost_runner` when another runner took the session; nothing is called, and the refusal is audited
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403write_not_grantedA change runs only for a module holding a write grant for it (PUT /v1/policies/grants/{product}/{capability}); a person's change is refused with 403 `write_not_granted` until people get write scopes
403write_consent_requiredWhen the server asks for write scopes on demand (NEXUS_CONNECTOR_WRITE_CONSENT), a change on an OAuth connection that holds none of the connector's write scopes is refused with 403 `write_consent_required`; nothing is called
404not_foundNothing matches the path in your organization
404label_unknown404 `label_unknown`
404session_not_found400 `invalid_session_fence` without both, 404 `session_not_found` for a session that is not yours, 409 `session_ended` for an ended one, and 409 `lost_runner` when another runner took the session; nothing is called, and the refusal is audited
409head_changed400 `merge_method_refused`, 409 `head_changed`, `not_mergeable` or `pull_not_open`
409pull_not_open`github/pull_edit` and `pull_reviewers` change only an open pull request (409 `pull_not_open`), and GitHub's refusal of a reviewer is 422 `reviewer_refused`
409pull_merged409 `pull_merged`, 422 `not_reopenable`
409session_ended400 `invalid_session_fence` without both, 404 `session_not_found` for a session that is not yours, 409 `session_ended` for an ended one, and 409 `lost_runner` when another runner took the session; nothing is called, and the refusal is audited
409lost_runner400 `invalid_session_fence` without both, 404 `session_not_found` for a session that is not yours, 409 `session_ended` for an ended one, and 409 `lost_runner` when another runner took the session; nothing is called, and the refusal is audited
409fence_requiredA change that names no fence while its credential holds a native session's live runner lease is refused with 409 `fence_required` (`error.nexus.session` names the session) when the server requires the fence; nothing is called, and the refusal is audited
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422reviewer_refused`github/pull_edit` and `pull_reviewers` change only an open pull request (409 `pull_not_open`), and GitHub's refusal of a reviewer is 422 `reviewer_refused`
422not_reopenable409 `pull_merged`, 422 `not_reopenable`
422idempotency_key_reusedThe Idempotency-Key was used with a different request
428Only while the Gateway enforces connector write keys (off by default): a change sent without `Idempotency-Key` (`idempotency_key_required`). Nothing was called.
428idempotency_key_requiredWhile the Gateway enforces connector write keys (off by default), a change without one is 428 `idempotency_key_required`, and nothing is called
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute
502reconciliation_failedA retry that cannot read the target is 502 `reconciliation_failed` and writes nothing

Example

curl
curl -X POST "$NEXUS_URL/v1/connectors/Platform/<operation>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Read connector

post/v1/connectors/{name}/{operation}/read

Run one connector operation that only reads, as the caller, with the credential the connector resolves for the call. 403 not_a_read when the operation changes something (use writeConnector), and 403 connector_disabled when the organization has not made the connector available to the caller. A scoped read is audited as connector.write. A repeat is safe, so it takes no idempotency key.

connectors.useEvery member, module keysTry it in the API Explorer

Parameters

  • namepath · stringrequired

    The connector, as GET /v1/connectors lists it (github, jira)

  • operationpath · stringrequired

    The operation, as GET /v1/connectors/{name} lists it

Request body · application/json

object

Responses

200OKapplication/json

object

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403not_a_read403 `not_a_read` when the operation changes something (use writeConnector), and 403 `connector_disabled` when the organization has not made the connector available to the caller
403connector_disabled403 `not_a_read` when the operation changes something (use writeConnector), and 403 `connector_disabled` when the organization has not made the connector available to the caller
404not_foundNothing matches the path in your organization
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/connectors/Platform/<operation>/read" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'