Connect or replace a service
PUT /v1/services/{serviceId}
Only with the user’s own token: through an App or channel bot, 404. Replaces the whole service, its secret always included; 201 when it is new. 409 host_in_use when another service holds a host, 409 service_limit at 20 services, 503 service_unavailable when it cannot be stored encrypted.
Authorizations
Parameters
Path Parameters
Request Body required
object
Display name, such as GitHub.
1 to 10 hosts, each once. A service with a google target has only google targets.
object
An exact lowercase DNS name with at least two labels, reached over HTTPS on its default port: no wildcard, port, path, IP literal or localhost. Bkper and Cloudflare Artifacts hosts are refused (400 host_not_allowed): they have their own routes.
object
An exact lowercase DNS name with at least two labels, reached over HTTPS on its default port: no wildcard, port, path, IP literal or localhost. Bkper and Cloudflare Artifacts hosts are refused (400 host_not_allowed): they have their own routes.
Basic only: the username sent with the secret. No colon.
object
An exact lowercase DNS name with at least two labels, reached over HTTPS on its default port: no wildcard, port, path, IP literal or localhost. Bkper and Cloudflare Artifacts hosts are refused (400 host_not_allowed): they have their own routes.
Header only: the header that carries the secret, such as x-api-key. Not host, content-length, transfer-encoding, connection.
object
Google only: a Google API host, ending in .googleapis.com, such as analyticsdata.googleapis.com. Not oauth2.googleapis.com (400 host_not_allowed).
Google services only, and always with google targets: the scopes their access tokens are made for.
object
1 to 20 OAuth scopes, each https://www.googleapis.com/auth/…, such as https://www.googleapis.com/auth/analytics.readonly.
Up to 8192 characters. A token: printable ASCII, without spaces at either end. For google, the service account’s JSON key file as it is (400 invalid_request when it is not a service account key). Write-only: never returned, logged or shown to the agent.
Responses
200
Replaced
A service the user connected: requests the agent sends to its hosts carry the stored secret, added outside the sandbox. The secret is never returned.
object
object
How the secret is sent. Open: bearer | basic | header | google.
Basic only.
Header only.
Google services only.
object
The service account’s email, read from its key: share what the agent should reach with it.
Milliseconds since the epoch, as a string.
Milliseconds since the epoch, as a string.
201
Connected
A service the user connected: requests the agent sends to its hosts carry the stored secret, added outside the sandbox. The secret is never returned.
object
object
How the secret is sent. Open: bearer | basic | header | google.
Basic only.
Header only.
Google services only.
object
The service account’s email, read from its key: share what the agent should reach with it.
Milliseconds since the epoch, as a string.
Milliseconds since the epoch, as a string.
400
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
401
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
403
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
404
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
409
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
410
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
411
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
413
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
503
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.