POST
Bar a member from locations
Company space For: Administrator · Permission: asset_restrictions_locations.create Conditions
  • Exactly one of agent_id or user_profile_id must be sent; sending both is refused.
  • The agent account or user profile must belong to the current company.
  • asset_ids must hold at least one identifier, without duplicates.
  • Every location must exist in the current organization, be of type location, not be deleted, and be shared with the current company.
  • The call is refused as a whole when the person is already restricted on any of the listed locations; no restriction is created in that case. A restriction that was lifted earlier does not count.
  • Either all the restrictions are created or none.
What else happens
  • Each listed location becomes not eligible (reason restricted) for that person within the current company wherever location eligibility is checked.
  • No stock, accounting or notification change.
Part of Limit access to locations and books.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, asset_id, company_id, restrictable_type, restrictable_id, deleted_at, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: asset.

Body

application/json
asset_ids
string[]
required

Identifiers of the locations (27-character KSUID strings). At least one, without duplicates. Each must be an existing location of the organization shared with the current company; on creation none may already be restricted for that person, on lifting each must currently be restricted.

Minimum array length: 1
Required string length: 27
agent_id
string | null

Identifier of the company agent account to restrict (27-character KSUID string). Required when user_profile_id is not sent; refused when user_profile_id is sent. The agent account must belong to the current company.

Required string length: 27
user_profile_id
string | null

Identifier of the user profile (a member's assignment in the current company) to restrict (27-character KSUID string). Required when agent_id is not sent. It must belong to the current company.

Required string length: 27

Response

Resource (only with response=resource).

id

Identifier of the restriction (27-character KSUID string).

asset_id

Identifier of the location the person is barred from (27-character KSUID string).

company_id

Identifier of the company the record belongs to.

restrictable_type

Kind of person restricted: agent account (a company agent account) or user_profile (a member's profile assignment in the company).

restrictable_id

Identifier of the restricted agent account or user profile (27-character KSUID string).

asset
object

Short location (id, name, type). Only rendered when requested with the include parameter.

deleted_at

Date and time the restriction was lifted (ISO 8601); null for an active restriction. Lists and creation only return active ones.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).