MobiariDocs

Invite someone to the store

POST
/stores/{store_id}/invites

Creates a pending invite, valid for a limited time, that grants role_ids to whoever accepts it with this e-mail. The roles may not grant permissions the inviter does not hold. The acceptance link is e-mailed to the invitee; its token is never returned. Someone new to the organization takes a seat of the plan.

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/invites" \  -H "Content-Type: application/json" \  -d '{    "email": "joao@example.com",    "role_ids": [      "3805f8ab-a16f-4b9c-912c-4f3e3ae2a6f1"    ]  }'
{
  "created_at": "2019-08-24T14:15:22Z",
  "email": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "invited_by": "0fdabe0c-eb7c-440a-96d2-2c65906c3777",
  "invited_by_name": "string",
  "role_ids": [
    "3805f8ab-a16f-4b9c-912c-4f3e3ae2a6f1"
  ],
  "role_names": [
    "string"
  ],
  "status": "pending",
  "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}