Skip to content

Upload records

POST
/v1/artifact_sources/{id}/records
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.

id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/

The artifact source’s id.

Media type application/json
object
records
required
Array<object>
>= 1 items <= 1000 items
object
ref_id
required

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.

string
>= 1 characters
raw_data
required

The record’s fields, keyed by name.

object
key
additional properties

The records were written.

Media type application/json
object
ingested
required

How many records were added or updated.

integer
<= 1000
source_id
required

The artifact source the records went to.

string format: uuid

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.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

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.

Media type application/json
Any of:
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

Example

{
"message": "API token turned off",
"code": "BR401"
}

The robot account can only view this artifact source: uploading needs Can edit.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

Example

{
"message": "API token turned off",
"code": "BR401"
}

No artifact source with this id is shared with the robot account.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

Example

{
"message": "API token turned off",
"code": "BR401"
}

The artifact source is a question set’s results table, which only its question set writes.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

Example

{
"message": "API token turned off",
"code": "BR401"
}

The request body is larger than 5 MiB.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

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.

Media type application/json
object
message
required

What went wrong.

string
hint

More about the error, such as which field is wrong.

string
code
required

A stable code for the kind of error.

string
details

Detail on the error, as a JSON string. A 400 for a field lists each field and why under errors.

string

Example

{
"message": "API token turned off",
"code": "BR401"
}