Skip to main content
API reference

Providers

Generated HTTP reference for the 4 operations the published OpenAPI document describes under providers.

5 min read
View MarkdownEdit on GitHub

Providers

This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.

Base URL: https://api.codespar.dev

Every operation below requires a Bearer token. See Authentication.

GET /v1/providers

List the MCP servers this project can attach to a session

Query parameters

NameTypeRequiredDescription
categorystringno
countrystringno
qstringno

Responses

StatusBodyDescription
200objectOK
400objectBad Request — the body or query did not match the schema.

Response 200

FieldTypeRequiredDescription
filteredintegeryes
serversarray of ServerCatalogRowyes
totalintegeryes

Example response

{
  "total": 0,
  "filtered": 0,
  "servers": [
    {
      "id": "servercatalogrow_0000000000000000",
      "name": "Example",
      "pkg": "string",
      "category": "string",
      "country": "string",
      "auth_type": "string",
      "tools_count": 1,
      "status": "string",
      "sandbox_available": true,
      "subaccount_provisionable": true,
      "engine_provisionable": true,
      "engine_status": "none"
    }
  ]
}

Example request

curl -X GET https://api.codespar.dev/v1/providers \
  -H "Authorization: Bearer $CODESPAR_API_KEY"

GET /v1/providers/{slug}

Read one provider

Responses

StatusBodyDescription
200ServerCatalogRowOK
404objectNot Found

Response 200

FieldTypeRequiredDescription
auth_typestringyes
categorystringyes
countrystringyes
descriptionstring,nullyes
engine_provisionablebooleanyesHas an engine provisioning descriptor AND is not quarantined.
engine_status"none" | "available" | "quarantined"yesCarries the reason engine_provisionable is false.
idstringyes
namestringyes
pkgstringyes
provider_docs_urlstring,nullno
provider_homepagestring,nullno
provider_logo_fallback_urlstring,nullno
provider_logo_urlstring,nullno
sandbox_availablebooleanno
sandbox_urlstring,nullno
statusstringyes
subaccount_provisionablebooleanyes
tools_countintegeryes

Example response

{
  "id": "servercatalogrow_0000000000000000",
  "name": "Example",
  "pkg": "string",
  "category": "string",
  "country": "string",
  "auth_type": "string",
  "tools_count": 1,
  "status": "string",
  "sandbox_available": true,
  "subaccount_provisionable": true,
  "engine_provisionable": true,
  "engine_status": "none"
}

Example request

curl -X GET https://api.codespar.dev/v1/providers/{slug} \
  -H "Authorization: Bearer $CODESPAR_API_KEY"

GET /v1/providers/{slug}/auth-schema

The connect form for one provider

Path parameters

NameTypeRequiredDescription
slugstringyesThe provider slug, which is also the catalog primary key.

Responses

StatusBodyDescription
200objectOK
404objectNot Found — no such provider for this caller. A generated provider belonging to another project answers here too, identically to one that does not exist: the listing already hides it, so answering differently would leak what the listing conceals.

Response 200

FieldTypeRequiredDescription
auth_type"api_key" | "path_secret" | "oauth" | "cert" | "none" | "hmac_signed" | "jwt_ecdsa" | "two_header" | "cdp"yesThe provider's declared auth mechanism, taken straight from the column. Nine values, which is the column constraint's set and NOT the six the shared types package publishes: three of these nine are wire values the published schema would reject, so validate against this list rather than against a generated type of that field.
base_urlstringyesThe provider host for this environment, or an empty string when the catalog holds no endpoint row for it.
environment"live" | "test"yesThe environment the credential authenticates in. Not a parameter of the request.
fieldsarray of objectyesIn the order the form should render them.
oauth_authorize_urlstring,nullyesWhere an OAuth connect lands the operator. Null for every other mechanism.
server_idstringyesEcho of the slug. The catalog primary key IS the slug — there is no second id.

Example response

{
  "server_id": "srv_0000000000000000",
  "auth_type": "api_key",
  "environment": "live",
  "base_url": "https://example.com/hook",
  "fields": [
    {
      "name": "Example",
      "kind": "api_key",
      "label": "Example",
      "header_name": "Example"
    }
  ]
}

Example request

curl -X GET https://api.codespar.dev/v1/providers/{slug}/auth-schema \
  -H "Authorization: Bearer $CODESPAR_API_KEY"

POST /v1/providers/{slug}/verify-connection

Test one provider connection's credential

Path parameters

NameTypeRequiredDescription
slugstringyesThe provider slug, which is also the catalog primary key.

Responses

StatusBodyDescription
200objectOK. The credential authenticated at the provider. latency_ms is the probe's own round trip.
401objectThe PROVIDER rejected the stored credential — a verdict, and the only failure here that is one. detail carries the provider's own words. This 401 never describes the caller's own credential: one that does not authenticate is refused before the handler runs.
404object | objectNot Found, and this status carries TWO different bodies. A generated provider belonging to another project is refused before the check runs, with the bare \{ error, server_id \} shape and no ok key. A provider that has a verify recipe but no catalog row reaches the checker and comes back as an ordinary failure with ok: false and error: "server_unknown". Branch on ok, not on the status.
409objectredirect_not_followed. The configured host answered with a redirect, which the probe does not follow, so the credential was never judged. Retrying cannot resolve it and reconfiguring can — which is why it is not a 502.
424objectnot_connected. There is no usable credential to test: no active connection for this project and provider, or the vault returned nothing for the reference it holds. This body carries the extra hint / alternative steer.
501objectverify_unsupported. Nothing ships that can check this provider — no recipe and no declared probe. The first real call will report authentication errors directly.
502objectprovider_unreachable, and it is WIDER than its name. It is returned for a transport failure or timeout, and also for EVERY provider response that is not 2xx, 3xx, 401 or 403 — a provider 400 or 404 arrives here too. Read status before retrying: absent means nothing was reached and a retry is reasonable; a 4xx there means the provider answered and will answer the same way again.
503objectendpoint_missing. The provider is known but its catalog entry cannot be called as configured. An operator fixes this; a caller cannot.

Response 200

FieldTypeRequiredDescription
accountobjectnoAbsent when the check ran through the generic probe rather than a provider-specific recipe: only a recipe extracts an account summary. Its absence is not a weaker pass.
latency_msintegeryes
oktrueyes
providerstringyes

Example response

{
  "ok": true,
  "provider": "string",
  "account": {
    "id": "obj_0000000000000000",
    "name": "Example",
    "extras": {}
  },
  "latency_ms": 0
}

Example request

curl -X POST https://api.codespar.dev/v1/providers/{slug}/verify-connection \
  -H "Authorization: Bearer $CODESPAR_API_KEY"
Providers | CodeSpar