younifyd
Menu

Get Access Request State

Get access request state

GET/v2024-07-01/access/{resourceType}/{resourceId}/requests/state

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Get Access Request State action (under Access).
  3. Fill in the fields below, then reference the result from later steps as {{getAccessRequestState.response.data}}.

Request

Path parameters

resourceTypestringrequired

The resource type to scope the access requests to.

One oforganizationprojectmedia-librarycanvasdashboardviewknowledge-base

resourceIdstringrequired

The resource ID to scope the access request to. Must be a valid ID for the resource type.

Query parameters

returnQuerystring

The caller's own query string, URL-encoded as a single value. It is carried through to the login page so the user returns to the request page after authenticating.

Response

Returns 200 with an object. Read it in later steps with {{getAccessRequestState.response.data.<field>}}.

statestring

Tells a client what to show before the user requests access. This is guidance, not permission. Creating the request and approving it run the final checks, so do not assume a request will succeed. The user can act on these results: - `eligible`: the client may offer the option to request access. - `saml-required`: normally, none of the user's linked SSO identities matches an enabled provider for the organization. Send the user to `redirectUrl` when present. If provider lookup failed, this state can appear without a URL and does not confirm an identity match. These results explain why the client should not offer a new request: - `resource-not-available`: the project or organization is not available. - `requests-disabled`: the organization does not allow access requests. - `already-member`: the user already has a directly assigned role on this resource. An organization role implied by a project role does not count as direct organization membership here. - `pending`: the user already has a pending request. `requestId` identifies it. - `recently-declined`: the user's request was declined within the last two weeks. - `saml-roles-managed`: the user has no directly assigned project role, and a linked SSO provider is set to assign mapped project roles on login. When `redirectUrl` is present, clients may offer it to help the user sign in again through that provider. Signing in does not guarantee a mapped role or access. - `temporarily-unavailable`: the service cannot currently advise a request action.

One ofeligiblesaml-requiredresource-not-availablerequests-disabledalready-memberpendingrecently-declinedsaml-roles-managedtemporarily-unavailable

redirectUrlstring

Present for `saml-required` when a login URL can be resolved, or for `saml-roles-managed` when the matched mapped provider supplies its login URL. Clients may offer it as a way to sign in; it may open a confirmation page before the identity provider. A supplied `returnQuery` can be carried through login, but a return to the previous page is not guaranteed. Signing in does not guarantee a mapped role or access.

providerNamestring

Present for `saml-roles-managed` when the provider has a name.

requestIdstring

Present for `pending` and identifies the existing request.

json
{
  "state": "eligible",
  "redirectUrl": "https://www.sanity.io/login/sso/acme?origin=https%3A%2F%2Fwww.sanity.io%2Fmanage%2Fproject%2Fabc123",
  "providerName": "string",
  "requestId": "string"
}

Need more? See the Sanity guide for connection setup and behaviour shared by every action.

Get Access Request State — Sanity — Documentation