Skip to content

intents_get

GET
/intents/{intent_id}
curl --request GET \
--url https://example.com/intents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0

Get a stored intent by its ID.

intent_id
required

Unique identifier for an intent, assigned by the caller.

string format: uuid

Intent ID

Intent found

Media type application/json

An intent together with its [Authorship].

When signed, the signature is over the JCS (JSON Canonicalization Scheme, RFC 8785) serialization of the intent. A signer serializes the intent with JCS and signs those bytes, for instance in TypeScript:

import canonicalize from "canonicalize";

const jcs = canonicalize(json_intent)
const bytes = new TextEncoder().encode(jcs)
const signed = signer.signBytes(bytes)
object
authorship
required
One of:

A signature over the JCS serialization of the intent.

object
Signed
required
One of:

Ed25519 signature

object
Ed25519
required

Ed25519 signature

object
pub_key
required

The [PubKey] of the signer

string
signature
required

The [Signature]

string
intent
required

The intent that is being authorized.

object
attrs

Attribute values that parameterize the policy.

In JSON, omit this field instead of putting "attrs": null.

object
fields
required
object
key
additional properties
id
required

Unique identifier for this intent.

string format: uuid
policy_id
required

ID of the policy that defines the rules for fulfilling this intent.

string
Example
{
"authorship": "Unsigned",
"intent": {
"attrs": {
"fields": {
"acceptable_genres": {
"Set": {
"String": [
"Fantasy",
"SciFi"
]
}
},
"condition": {
"String": "new"
},
"max_price_cents": {
"Int": 3000
}
}
},
"id": "4ba223e7-fcb0-442e-96f0-b4a2b07080ca",
"policy_id": "4Bh9qrxKWLfPEUFs6hKqtzL75dPQyj9hSLHmDr8wqDap"
}
}

Intent not found

Media type application/json
object
message
required
string
Example generated
{
"message": "example"
}

Internal error

Media type application/json
object
message
required
string
Example generated
{
"message": "example"
}