Auth Admin API
The Auth Admin API allows you to get information about a grant, such as its status, state, related payment details, and the wallet address of the grantee’s account. The API also allows you to revoke grants.
API Endpoints
# Staging:
https://staging.example.com/graphql
Queries
grant
Description
Fetch a specific grant by its ID.
Example
Query
query Grant($id: ID!) {
grant(id: $id) {
id
client
access {
id
identifier
type
actions
limits {
...LimitDataFragment
}
createdAt
}
state
finalizationReason
createdAt
}
}
Variables
{"id": 4}
Response
{
"data": {
"grant": {
"id": 4,
"client": "abc123",
"access": [Access],
"state": "PROCESSING",
"finalizationReason": "ISSUED",
"createdAt": "abc123"
}
}
}
grants
Description
Fetch a paginated list of grants.
Response
Returns a
GrantsConnection!
Arguments
Name | Description |
---|---|
after
-
String
|
Forward pagination: Cursor (grant ID) to start retrieving grants after this point. |
before
-
String
|
Backward pagination: Cursor (grant ID) to start retrieving grants before this point. |
first
-
Int
|
Forward pagination: Limit the result to the first
n grants after the
after cursor.
|
last -
Int
|
Backward pagination: Limit the result to the last
n grants before the
before cursor.
|
filter
-
GrantFilter
|
Filter grants based on specified criteria such as ID, state, or finalization reason. |
sortOrder
-
SortOrder
|
Specify the sort order of grants based on their creation date, either ascending or descending. |
Example
Query
query Grants(
$after: String,
$before: String,
$first: Int,
$last: Int,
$filter: GrantFilter,
$sortOrder: SortOrder
) {
grants(
after: $after,
before: $before,
first: $first,
last: $last,
filter: $filter,
sortOrder: $sortOrder
) {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
edges {
node {
...GrantFragment
}
cursor
}
}
}
Variables
{
"after": "xyz789",
"before": "xyz789",
"first": 123,
"last": 987,
"filter": GrantFilter,
"sortOrder": "ASC"
}
Response
{
"data": {
"grants": {
"pageInfo": PageInfo,
"edges": [GrantEdge]
}
}
}
Mutations
revokeGrant
Description
Revoke an existing grant.
Response
Returns a
RevokeGrantMutationResponse!
Arguments
Name | Description |
---|---|
input
-
RevokeGrantInput!
|
Example
Query
mutation RevokeGrant($input: RevokeGrantInput!) {
revokeGrant(input: $input) {
id
}
}
Variables
{"input": RevokeGrantInput}
Response
{"data": {"revokeGrant": {"id": "4"}}}
Types
Access
Fields
Field Name | Description |
---|---|
id -
ID!
|
Unique identifier of the access object. |
identifier
-
String
|
Wallet address of the sub-resource (incoming payment, outgoing payment, or quote). |
type -
String!
|
Type of access (incoming payment, outgoing payment, or quote). |
actions
-
[String]!
|
Actions allowed with this access. |
limits
-
LimitData
|
Limits for an outgoing payment associated with this access. |
createdAt
-
String!
|
The date and time when the access was created. |
Example
{
"id": 4,
"identifier": "xyz789",
"type": "xyz789",
"actions": ["xyz789"],
"limits": LimitData,
"createdAt": "xyz789"
}
Boolean
Description
The Boolean
scalar type represents
true
or false
.
Example
true
FilterFinalizationReason
Fields
Input Field | Description |
---|---|
in -
[GrantFinalization!]
|
List of finalization reasons to include in the filter. |
notIn
-
[GrantFinalization!]
|
List of finalization reasons to exclude in the filter. |
Example
{"in": ["ISSUED"], "notIn": ["ISSUED"]}
FilterGrantState
Fields
Input Field | Description |
---|---|
in -
[GrantState!]
|
List of states to include in the filter. |
notIn
-
[GrantState!]
|
List of states to exclude in the filter. |
Example
{"in": ["PROCESSING"], "notIn": ["PROCESSING"]}
FilterString
Fields
Input Field | Description |
---|---|
in -
[String!]
|
Array of strings to filter by. |
Example
{"in": ["abc123"]}
Grant
Fields
Field Name | Description |
---|---|
id -
ID!
|
Unique identifier of the grant. |
client
-
String!
|
Wallet address of the grantee's account. |
access
-
[Access!]!
|
Details of the access provided by the grant. |
state
-
GrantState!
|
Current state of the grant. |
finalizationReason
-
GrantFinalization
|
Specific outcome of a finalized grant, indicating whether the grant was issued, revoked, or rejected. |
createdAt
-
String!
|
The date and time when the grant was created. |
Example
{
"id": 4,
"client": "xyz789",
"access": [Access],
"state": "PROCESSING",
"finalizationReason": "ISSUED",
"createdAt": "xyz789"
}
GrantEdge
GrantFilter
Fields
Input Field | Description |
---|---|
identifier
-
FilterString
|
Filter grants by their unique identifier. |
state
-
FilterGrantState
|
Filter grants by their state. |
finalizationReason
-
FilterFinalizationReason
|
Filter grants by their finalization reason. |
Example
{
"identifier": FilterString,
"state": FilterGrantState,
"finalizationReason": FilterFinalizationReason
}
GrantFinalization
Values
Enum Value | Description |
---|---|
|
The grant was issued successfully. |
|
The grant was revoked. |
|
The grant request was rejected. |
Example
"ISSUED"
GrantState
Values
Enum Value | Description |
---|---|
|
The grant request is processing. |
|
The grant request is awaiting interaction. |
|
The grant request has been approved. |
|
The grant request has been finalized, and no more access tokens or interactions can be made. |
Example
"PROCESSING"
GrantsConnection
Fields
Field Name | Description |
---|---|
pageInfo
-
PageInfo!
|
Information to aid in pagination. |
edges
-
[GrantEdge!]!
|
A list of edges representing grants and cursors for pagination. |
Example
{
"pageInfo": PageInfo,
"edges": [GrantEdge]
}
ID
Description
The ID
scalar type represents a unique
identifier, often used to refetch an object or as key for a
cache. The ID type appears in a JSON response as a String;
however, it is not intended to be human-readable. When
expected as an input type, any string (such as
"4"
) or integer (such as
4
) input value will be accepted as an ID.
Example
"4"
Int
Description
The Int
scalar type represents non-fractional
signed whole numeric values. Int can represent values
between -(2^31) and 2^31 - 1.
Example
123
LimitData
Fields
Field Name | Description |
---|---|
receiver
-
String
|
Wallet address URL of the receiver. |
debitAmount
-
PaymentAmount
|
Amount to debit. |
receiveAmount
-
PaymentAmount
|
Amount to receive. |
interval
-
String
|
Interval between payments. |
Example
{
"receiver": "abc123",
"debitAmount": PaymentAmount,
"receiveAmount": PaymentAmount,
"interval": "xyz789"
}
Model
PageInfo
Fields
Field Name | Description |
---|---|
endCursor
-
String
|
The cursor used to fetch the next page when paginating forward. |
hasNextPage
-
Boolean!
|
Indicates if there are more pages when paginating forward. |
hasPreviousPage
-
Boolean!
|
Indicates if there are more pages when paginating backward. |
startCursor
-
String
|
The cursor used to fetch the next page when paginating backward. |
Example
{
"endCursor": "abc123",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "abc123"
}
PaymentAmount
Fields
Field Name | Description |
---|---|
value
-
UInt64!
|
The value of the payment amount. |
assetCode
-
String!
|
Should be an ISO 4217 currency code whenever possible,
e.g. USD . For more information, refer to
assets.
|
assetScale
-
UInt8!
|
Difference in orders of magnitude between the standard unit of an asset and a corresponding fractional unit. |
Example
{
"value": UInt64,
"assetCode": "xyz789",
"assetScale": UInt8
}
RevokeGrantInput
Fields
Input Field | Description |
---|---|
grantId
-
String!
|
Unique identifier of the grant to revoke. |
Example
{"grantId": "xyz789"}
RevokeGrantMutationResponse
Fields
Field Name | Description |
---|---|
id -
ID!
|
Unique identifier of the revoked grant. |
Example
{"id": "4"}
SortOrder
Values
Enum Value | Description |
---|---|
|
Sort the results in ascending order. |
|
Sort the results in descending order. |
Example
"ASC"
String
Description
The String
scalar type represents textual data,
represented as UTF-8 character sequences. The String type is
most often used by GraphQL to represent free-form
human-readable text.
Example
"abc123"
UInt64
Description
The UInt64
scalar type represents unsigned
64-bit whole numeric values. It is capable of handling
values that are larger than the JavaScript
Number
type limit (greater than 2^53).
Example
UInt64
UInt8
Description
The UInt8
scalar type represents unsigned 8-bit
whole numeric values, ranging from 0 to 255.
Example
UInt8