access

PUT /v1/orgs/{orgId}/delegated-access

Set exactly which sites one person holds, and the role on each.

Све access крајње тачке

Сва документација за програмере →

Аутентификација

Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.

Где се уноси ID ваше организације

Ова крајња тачка узима ID ваше организације у самом URL-у, као orgId. Замените га у путањи — не постоји заглавље или параметар упита који могу послужити уместо тога.

Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.

Испробајте

Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.

curl -X PUT https://api.zinndigital.com/v1/orgs/{orgId}/delegated-access \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "email": <string>, "sites": <object[]> }'

Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли

Детаљи

One call for every change to one person: invite them, add a site, change a role, remove a site. After it the person holds EXACTLY the sites in sites. Sites they already hold keep their grant and have the role (and, when expires_at is sent, the end date) updated in place; new sites are granted — or, for an address with no account, invited, with one invitation however many sites; sites left out are revoked. The whole call is atomic: one refused site leaves every other site as it was. The same rules as sharing one site (shareSiteWithCollaborator) apply, with the same codes: SITE_COLLABORATOR_ALREADY_A_MEMBER (409), SITE_COLLABORATOR_ALREADY_INVITED (409), SITE_COLLABORATOR_EXPIRY_IN_THE_PAST (422) and SITE_COLLABORATOR_REASON_REQUIRED (422 — a new site for somebody with no reason on record). Two are this endpoint's own: SITE_COLLABORATOR_SITE_NOT_IN_ORG (422 — one code for "no such site" and "a site of another organisation", so it is not an oracle) and SITE_COLLABORATOR_DUPLICATE_SITE (422). Saving a person whose invitation has lapsed sends it again; saving one whose invitation is still live does not. To remove every site, use the revoke endpoint — an empty sites is refused, so an accidental untick of the last box is never a revoke.

Параметри

НазивТипОбавезноШта је ово
orgId (path)UuidДаOrganization ID (UUIDv7).

Тело захтева

НазивТипОбавезноШта је ово
emailstringДа—
sitesobject[]ДаThe EXACT sites the person should hold after the call.
reasonstringНеWhy this person is being given these sites. Required when the call writes a new grant for somebody with no reason on record; otherwise the reason on record is kept.
expires_atobjectНеOmitted leaves every end date as it is; null means until revoked, for every site.

Одговор

НазивТипОбавезноШта је ово
emailstringДа—
user_idobjectДаNull for somebody who has only been invited.
namestringДа—
statusstring<active, pending, expired>Да—
site_countintegerДаSites in force or awaiting acceptance.
reasonstringДаThe most recent reason recorded for sharing with this person.
invited_atstringДа—
accepted_atobjectДаWhen they accepted — or, shared straight to an existing account, when access began. Null while pending.
invitation_expires_atobjectДаWhen a pending invitation stops being acceptable. Saving the person sends a lapsed one again.
last_active_atobjectДа—
sitesDelegatedSite[]Да—

Грешке које ова крајња тачка може вратити

401 · 403 · 404 · 409 · 422 · 429