Upload records
const url = 'https://app.region.admire.ai/api/v1/artifact_sources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/records';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"records":[{"ref_id":"pr-1042","raw_data":{"title":"Fix login","author":"sam","merged":true}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.region.admire.ai/api/v1/artifact_sources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/records \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "records": [ { "ref_id": "pr-1042", "raw_data": { "title": "Fix login", "author": "sam", "merged": true } } ] }'Adds records to an artifact source, or updates the ones whose Reference ID (ref_id) it already holds, so a second run with the same Reference IDs adds no rows. The robot account needs Can edit on the source.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The artifact source’s id.
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
object
The record’s Reference ID, its key in the system it comes from. It appears once per call; sending it again in a later call updates the row.
The record’s fields, keyed by name.
object
Responses
Section titled “ Responses ”The records were written.
object
How many records were added or updated.
The artifact source the records went to.
Example
{ "ingested": 2, "source_id": "0b9f1c2e-5d4a-4f6b-9a3e-7c8d2e1f0a4b"}The request is not valid: message says what is wrong and, for a field that fails the schema, hint names it and says why.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}The API token is missing, made up or expired, and the gateway refused it with only message; or it is unknown, turned off or expired, or its robot account is disabled.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
object
Always Unauthorized.
Example
{ "message": "API token turned off", "code": "BR401"}The robot account can only view this artifact source: uploading needs Can edit.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}No artifact source with this id is shared with the robot account.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}The artifact source is a question set’s results table, which only its question set writes.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}The request body is larger than 5 MiB.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}The batch would take the artifact source past the records its organization allows, so nothing was written.
object
What went wrong.
More about the error, such as which field is wrong.
A stable code for the kind of error.
Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.
Example
{ "message": "API token turned off", "code": "BR401"}