Skip to main content

IDs

Every object in Black has an ID of one form. The ID names the kind of object it belongs to, so you can tell an account from an environment by reading it.

Read an ID​

An ID is a short prefix that names the kind of object, an underscore, and 26 lowercase letters and digits:

acct_01m76yzrj5cmerzrn6cb3tde11

Treat the ID as an opaque string: store it and send it back as it is.

Sort IDs​

IDs of one kind sort in the order the objects were created. Sort them as plain strings, and the older object comes first.

Use an ID in an address​

Send an ID in the address of the kind of object it names. An ID with the wrong prefix for the address is answered as not found: the response has status 404 and the resource_not_found code, in the error shape described in Errors. To fix it, check that the ID you send belongs to the kind of object in the address.

Know that internal keys stay hidden​

The internal database keys of Black never appear in a response. The ID you read is the only identifier of an object.

Find the prefix of each kind of object​

PrefixNames
acctAn account
envAn environment
reqA request. See Request IDs.