Documentation / Grade AI

Commit a proposalBeta

wallet balance · bash
BASE_URL="https://<your-backend-host>"
APP_ID="app_..."
API_KEY="sk_..."

curl -sS "$BASE_URL/sdk/v1/wallet/balance" \
  -H "X-Application-Id: $APP_ID" \
  -H "X-Api-Key: $API_KEY"
All documentation
POST/sdk/v1/agent/commit

Saves what a person confirmed: send the proposal_token of the assistant's action event, unchanged. Grade calls the SDK v1 routes the proposal stands for with your key, so each route applies its own scopes, rules and audit. A second commit of the same proposal answers the first receipt.

Base URL

Environment URL
Production https://infra.usegrade.com/api/email
Sandbox https://infra-sandbox.usegrade.com/api

Headers

Required on every request, as on every SDK v1 route.

Header Value
X-Application-Id Your SDK application ID.
X-Api-Key Your SDK API key secret.
Content-Type application/json

Request body

The proposal to commit.

Property Type Required Description
proposal_token string, at most 65,536 characters Yes The action event's proposal_token.

A property this table does not name is refused.

Responses

200

The receipt: one row per creator or post.

Property Type Required Description
proposal_id string Yes
action string Yes
status one of saved, partial, refused Yes
http_status integer Yes The status the rows share, or 207 when they differ.
rows array of object Yes
rows[].key string Yes The id of the creator or post the row is about.
rows[].http_status integer or null Yes
rows[].status one of saved, refused, unknown, not_sent Yes

400

The proposal cannot be committed.

Property Type Required Description
success false Yes
code one of PROPOSAL_INVALID, PROPOSAL_EXPIRED, PROPOSAL_OTHER_AGENCY, ACTION_NOT_ALLOWED, ACTION_OFF, SCOPE_MISSING, REQUEST_NOT_ALLOWED, RATE_LIMITED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_UNAVAILABLE, AGENT_UNCONFIGURED, COMMIT_UNAVAILABLE, COMMIT_OUTCOME_UNKNOWN Yes
message string Yes

403

The key, the organization or the action does not allow this commit.

Property Type Required Description
success false Yes
code one of PROPOSAL_INVALID, PROPOSAL_EXPIRED, PROPOSAL_OTHER_AGENCY, ACTION_NOT_ALLOWED, ACTION_OFF, SCOPE_MISSING, REQUEST_NOT_ALLOWED, RATE_LIMITED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_UNAVAILABLE, AGENT_UNCONFIGURED, COMMIT_UNAVAILABLE, COMMIT_OUTCOME_UNKNOWN Yes
message string Yes

409

The proposal is already being committed, or was committed with another payload.

Property Type Required Description
success false Yes
code one of PROPOSAL_INVALID, PROPOSAL_EXPIRED, PROPOSAL_OTHER_AGENCY, ACTION_NOT_ALLOWED, ACTION_OFF, SCOPE_MISSING, REQUEST_NOT_ALLOWED, RATE_LIMITED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_UNAVAILABLE, AGENT_UNCONFIGURED, COMMIT_UNAVAILABLE, COMMIT_OUTCOME_UNKNOWN Yes
message string Yes

413

proposal_token is over 65536 bytes.

Property Type Required Description
success false Yes
code one of PROPOSAL_INVALID, PROPOSAL_EXPIRED, PROPOSAL_OTHER_AGENCY, ACTION_NOT_ALLOWED, ACTION_OFF, SCOPE_MISSING, REQUEST_NOT_ALLOWED, RATE_LIMITED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_UNAVAILABLE, AGENT_UNCONFIGURED, COMMIT_UNAVAILABLE, COMMIT_OUTCOME_UNKNOWN Yes
message string Yes

503

Grade could not commit right now; the receipt says what was sent.

Property Type Required Description
success false Yes
code one of PROPOSAL_INVALID, PROPOSAL_EXPIRED, PROPOSAL_OTHER_AGENCY, ACTION_NOT_ALLOWED, ACTION_OFF, SCOPE_MISSING, REQUEST_NOT_ALLOWED, RATE_LIMITED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_UNAVAILABLE, AGENT_UNCONFIGURED, COMMIT_UNAVAILABLE, COMMIT_OUTCOME_UNKNOWN Yes
message string Yes

Describe your program.

Grade turns it into a program it can track and pay.