POST/api/v1/projects/{projectId}/specs/raw

Ingest a spec from its content

Ingests an OpenAPI or Swagger document passed as a string, makes it the current spec when it is valid, and starts generating docs. Poll getSpecStatus with the returned specId until generation finishes.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 3 body fields
projectIdstringrequired

The project's ID, from listProjects.

contentstringrequired

The whole spec document, as JSON or YAML text.

expectedCurrentSpecIdstringoptional

Refuse the ingest if this is no longer the current spec, so a concurrent push is not overwritten.

formatstringoptional

The format of content. Detected when omitted.

Allowed:jsonyaml

5 status codes
201The spec was ingested and generation started.
endpointCountintegerrequired
jobsarray<object>required
limitAppliedbooleanoptional

True when the plan processed fewer endpoints than the spec has.

processedEndpointsintegeroptional
specIdstringrequired
totalEndpointsintegeroptional
upgradeMessagestringoptional
versionstringrequired
400The request failed validation.
errorobjectrequired
401The API key is missing or invalid.
errorobjectrequired
404The project or resource does not exist in this organisation.
errorobjectrequired
422The content is not a valid spec.
errorobjectrequired

Error handling

A 400 is returned: The request failed validation. A 401 is returned: The API key is missing or invalid. A 404 is returned: The project or resource does not exist in this organisation. A 422 is returned: The content is not a valid spec.