Skip to content

Contact - Create ​

Overview ​

Creates a new Contact record in the Biosafety Clearing-House and initiates the publishing workflow — identifier check, securities, validation, draft and workflow — in a single call.

Endpoint ​

POST /api/v2023/documents/schemas/contact

The identifier may also be supplied in the path — POST /api/v2023/documents/schemas/contact/:identifier? — otherwise it is taken from the document's header.identifier.

Headers ​

HeaderRequiredDescription
Content-TypeYesMedia type of the request body. The allowed value is application/json.
AuthorizationYesBearer token authenticating the request (Bearer <token>). Obtain it from the User - Authentication endpoint.
AcceptNoFormat the client expects in the response. The allowed value is application/json.
RealmNoThe Clearing-House context. May be sent here instead of the realm query parameter.

Path Parameters ​

ParameterDescription
schemaThe record type being published: contact.
identifierOptional. The record's unique identifier; when omitted it is taken from the document's header.identifier.

Query Parameters ​

ParameterRequiredDescription
realmYesThe Clearing-House context. For this application and environment: bch. May alternatively be sent as the Realm HTTP header.

Request Body ​

The request body is a JSON object with three top-level fields:

FieldTypeRequiredDescription
documentObjectYesThe record itself — the fields listed below, wrapped in a document object (its header plus the record-type fields).
additionalInfoStringNoUp to 1000 characters. Available only when a user with the NAU role submits a request to the Publishing Authority (PA) to publish a record.
batchIdStringNoUp to 100 characters. Batches multiple records together for publishing.

The fields of the document object are below. The record's identifier is taken from header.identifier; publishing fails if a record or draft with that identifier already exists.

TitleFieldMandatoryTypeExample
headerHeader{ "identifier": "068C83BA-995F-08C3-50CE-AD43545B3EB5", "schema": "contact", "languages": ["en"] }
Prefixprefixlstring{"en":"Mr"}
First NamefirstNameTruestringJohn
Middle NamemiddleNamestringSmith
Last NamelastNameTruestringDoe
GendergenderTerm
Job Titledesignationlstring{"en":"Software"}
OrganizationorganizationTruelstring{"en":"Test Organization"}
AcronymorganizationAcronymlstring{"en":"CSBD"}
Department / Division / Unitdepartmentlstring{"en":"Division"}
Type of OrganizationorganizationTypeTerm{"identifier":"86D464C3-B5BB-4B02-85E4-1AAD8D64CD27"}
Street Addressaddresslstring{"en":"560 Franklin"}
Citycitylstring{"en":"Cambridge"}
State or Provincestatelstring{"en":"Ontario"}
Postal Code or ZippostalCodelstring{"en":"N1R 7Z1"}
Country of ContactcountryTrueTerm{"identifier":"ca"}
Phone Number(s)phonesstring[]["54825578896"]
Fax Number(s)faxesstring[]["123456"]
Email(s)emailsTruestring[]["john.doe@example.com"]
Website Address(es)websitesLink[][{"url":"http://www.example.com"}]
Address TypeaddressTypestringorganization
Relevant InformationrelevantInformationlstring
Relevant DocumentsrelevantDocumentsLink[]
Contact TypetypeTruestringperson
CountrygovernmentTerm{"identifier":"af"}
OrganizationcontactOrganizationTrueReference{"identifier":"SIMP-22D52282-2FB2-AD2A-2965-476DFF6A7F37@1"}

Response ​

A successful call returns the saved draft and the publishing workflow that was started. Validation failures also return HTTP 200, with an errors array in the body instead — always check the response body, not just the status code.

When the document fails validation, the issues are returned in the errors property of the response (with HTTP 200). Each entry names the error code and the property it applies to:

json
{
  "identifier": "DECLARE-ORGANISATION_5885_20241031144831187",
  "errors": [
    { "code": "Error.Mandatory", "property": "government" }
  ]
}
Error TypeDescription
Error.MandatoryA required field is missing.
Error.MandatoryAnyOfAt least one field from a set of mandatory fields is missing.
Error.InvalidValueThe provided value is not valid according to the schema.
Error.InvalidPropertyAn invalid property or field name.
Error.UnspecifiedLocaleA locale or language code is missing or invalid.
Error.UnexpectedTermAn unexpected term or parameter.
Error.InvalidTypeThe provided data type is not valid.

Errors ​

The following error conditions may occur while interacting with the API. Each entry describes a specific error status code, along with an error message explaining the issue and any additional requirements for successful execution.

Status CodeDescription
400realm param is missing, please provide valid realm in querystring or httpHeaders.
400Realm is not configured, please provide valid realm.
400Schema not configured for the given realm.
400A document with the identifier exists, please use a different identifier.
400A document with the identifier does not exist, please provide correct identifier to update.
400The record is locked for workflow, cannot proceed.
403Insufficient rights to create a draft record.
403Insufficient rights to update the draft record.
403Authorization required, user is anonymous.

Playground ​

Swagger playground is loading, please wait...
Legacy alternative. Publishing through the legacy v2013 API uses the Save Draft endpoint plus a workflow call; new integrations should use this single v2023 call instead. The record's other draft operations (drafts, locks, securities, validation, versions) are documented under Draft Operations.