Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview
On this page

Assign a member

Make a member of your organization the Assignee of a Brand or a Campaign Plan, and list the records assigned to a member.

An Assignee is a current member of your organization who is accountable for a Brand or a Campaign Plan. An Assignee grants no access. Every role with the write scope of the record can still edit it. A record has at most 10 Assignees, and a new record has none.

A person adds Assignees in the console. Your code adds them with the Context API.

Read the Assignees

A read of a Brand or a Campaign Plan answers assignees: a list of { id, name }, oldest first. Each row of a list answers it too. A member who left the organization is not in the list.

Add an Assignee

Send person to the Brand or the Campaign Plan. person is me, a usr_… id, or an email address.

curl -X POST https://api.adcrunch.dev/context/brands/acme/assignees \
  -H "Authorization: Bearer $ADCRUNCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "person": "maya@example.com" }'

The answer is the Assignees of the record after the call:

{ "assignees": [{ "id": "usr_4d8b12", "name": "Maya Lindqvist" }] }
  • me is the person of your session. For an API key, it is the person who created the key.
  • An add of a person who is an Assignee already changes nothing.
  • A person who is not a current member gets 422 with error: "not_a_member". An email that matches no member gets the same answer, so the answer never tells whether an email has an AdCrunch account.
  • An 11th Assignee gets 422 with error: "assignee_limit".

An add or a remove does not change the revision or the status of the record. An approved Campaign Plan stays approved. So the call takes no base_revision.

The same calls exist for a Campaign Plan, at /context/campaign-plans/{slug}/assignees. Each call needs the write scope of the record: brand:write or campaign_plan:write.

Remove an Assignee

Send a DELETE with the person in the path:

curl -X DELETE https://api.adcrunch.dev/context/brands/acme/assignees/usr_4d8b12 \
  -H "Authorization: Bearer $ADCRUNCH_API_KEY"

A remove of a person who is not an Assignee changes nothing.

List the records of a member

The list of Brands and the list of Campaign Plans accept assignee: me or a usr_… id.

curl "https://api.adcrunch.dev/context/campaign-plans?assignee=me" \
  -H "Authorization: Bearer $ADCRUNCH_API_KEY"

A usr_… id that is not a current member gives an empty page. The cursor belongs to the filter: send the same assignee with each page.

Was this page helpful?