Organization APIs
Organization APIs manage administrative records the account owns. All requests authenticate with a secret key.
Lists
A list is named by an alias and holds members. A member is a text
string, such as a merchant identifier. A list accepts up to
5000 members per request.
Members are case sensitive. A member returns in the case it was added, and two
members differing only in case are two members, removed one at a time. A
removal matches a stored member exactly, so an identifier whose case differs
is reported missing rather than removed. Surrounding whitespace
is trimmed, and a response names a member in the form the list stores rather
than the form it was sent. A list alias is not case sensitive.
Features that scope themselves to a list match a member without regard to
case.
Permissions
| Permission | Grants |
|---|---|
organization:units:read |
Read lists and their members |
organization:units:manage |
Add and remove members |
organization:units:* |
Both of the above |
List Lists
Request
GET /ou
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
Response
{
data: [
{
alias: String,
createdAt: String,
updatedAt: String
}
]
}
Add Members
Request
POST /ou/:alias/add
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
data: {
members: [String]
}
}
| Field | Type | Required | Description |
|---|---|---|---|
members |
Array of Strings | Yes |
The strings to add, such as merchant identifiers as they appear in
processor records (e.g., ["565500000928297"])
|
Response
{
data: {
added: [String],
alias: String,
duplicates: [String],
errors: [
{
member: String,
message: String
}
],
total: Number
}
}
| Field | Type | Description |
|---|---|---|
added |
Array of Strings | Successful member additions |
duplicates |
Array of Strings | Skipped members, already enrolled |
errors |
Array of Objects |
Each object is the failed member and a message describing the error
|
total |
Number | Resulting member count |
Remove Members
Request
POST /ou/:alias/remove
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
data: {
members: [String]
}
}
Response
{
data: {
alias: String,
errors: [
{
member: String,
message: String
}
],
missing: [String],
removed: [String],
total: Number
}
}
| Field | Type | Description |
|---|---|---|
errors |
Array of Objects |
Each object is the failed member and a message describing the error.
|
missing |
Array of Strings | Members not found on the list |
removed |
Array of Strings | Members successfully removed from the list |
total |
Number | Resulting member count |
List Members
Page through the members on a list. Members return in sorted order,
500 at a time by default and 1000 at most.
When another page exists, the response carries metadata.cursor,
the last member returned. Pass it back as cursor to read the next
page. The final page carries no metadata. Pages are keyed by
member, so a member added mid-listing shifts no page already read.
Request
GET /ou/:alias/members?limit=500&cursor=565500000928297
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
Number | No | Members per page. Defaults to 500, capped at 1000 |
cursor |
String | No |
The metadata.cursor from the previous page. Omit for the first
page
|
Response
{
data: [String],
metadata: {
cursor: String
}
}
Errors
A request that fails answers with an errors envelope in place of
data. An entry that a successful request could not read is
reported in that response’s data.errors instead.
| Status | Cause |
|---|---|
400 Bad Request |
Missing data, or an empty or oversized
members
|
401 Unauthorized |
Missing, malformed, or revoked secret key |
403 Forbidden |
Key lacks the required units permission |
404 Not Found |
No such list in the calling key’s organization |