{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Authentication & authorization","description":"Reference, guides, and webhooks for the Aiwyn API: clients, contacts, engagements, projects, billing, payments, time, and files.","llmstxt":{"title":"Aiwyn API","description":"Aiwyn Product API documentation. Start with reference/quickstart.md; the API reference lists every endpoint, its required role, its request and response schemas, and the webhook payload."}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"authentication--authorization","__idx":0},"children":["Authentication & authorization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Product API access is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["role-based"]},". Each API key is provisioned with one or more"," ","roles in the Firm Portal. If your key lacks the role an endpoint requires, the request"," ","returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 Forbidden"]},"; if it carries no valid token at all, it returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401 Unauthorized"]},"."," ","See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/errors"},"children":["Errors"]}," for the exact response shapes."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each endpoint page states its requirement in a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required role"]}," line at the top of"," ","its description."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-base-role","__idx":1},"children":["The base role"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every key holds ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]},"; a key without it can't get a token. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]}," covers:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Every read under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/gql/v1/"]},", such as clients, engagements, projects, invoices, and payments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v1/"]}," endpoints whose page lists it, such as reading files and creating or updating staff."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every other ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v1/"]}," endpoint needs the role its page lists, so request the roles for the"," ","endpoints your integration calls."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"roles","__idx":2},"children":["Roles"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Firm Portal name"]}," is what a firm admin sees when issuing or editing a key."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Role"},"children":["Role"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Firm Portal name"},"children":["Firm Portal name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Grants"},"children":["Grants"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API Admin"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The base role. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#the-base-role"},"children":["The base role"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CLIENT_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Clients"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Onboard new clients, creating the client and its contacts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ENG_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Engagements"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create engagement letters, one at a time or in batches, update engagements, and read the status of batch creations."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROJ_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Projects"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create projects from project templates, and assign staff to or remove staff from projects."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INVC_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Invoices"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read a client's unpaid invoices."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PAYLNK_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create Payment Links"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create single-use quick payment links for clients."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RECD_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Records"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read the available record types and their field schemas, but not the records themselves."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RECD_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Records"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, update, and inactivate records, including clients, contacts, projects, staff, tasks, and custom records, through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v1/records"]},". Upsert contacts. Read record types and their field schemas."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CUSTYP_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Custom Types"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read custom record type definitions."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CUSTYP_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Custom Types"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, update, deactivate, and read custom record type definitions."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TM_CODE_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Time Codes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Look up time, expense, operational, and PTO codes and their field schemas."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TM_CODE_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Time Codes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create and update time, expense, operational, and PTO codes, and look them up."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TM_ENTRY_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Time Entries"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Look up time, expense, operational, and PTO entries and their field schemas."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TM_ENTRY_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Time Entries"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create and update time, expense, operational, and PTO entries, and look them up."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["STF_TYP_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Staff Types"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Look up staff types."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["STF_TYP_C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Staff Types"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create staff types in batches, and look them up."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EVNT_SUB"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event Subscriptions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, update, deactivate, and reactivate webhook event subscriptions, and read them, their delivery history, and the webhook signing secret."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PYMT_EVNT_ALL"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["All Payment Events"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Let payment event subscriptions receive every payment in the firm (the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allPayments"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentLinkOnly"]}," filters), not only payments through the key's own links. Use with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EVNT_SUB"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WEBHK_TST"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Webhook Testing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Generate and validate signed test webhook payloads."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FILE_R"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["View Files"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get a signed download URL from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v1/files/{id}"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["includeDownloadUrl=true"]},". Keys issued in the Firm Portal need it for that; other keys don't."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_USR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API Access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No endpoint in this reference requires it. Reads use the base role."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some roles, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FILE_C"]}," (creating file upload URLs and linking files) and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUPER_ADMIN"]}," ","(managing staff role assignments), aren't offered in the Firm Portal. Ask your Aiwyn contact"," ","if you need one."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoints-that-also-accept-api_admin","__idx":3},"children":["Endpoints that also accept ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v1/"]}," endpoints accept ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]}," as an alternative to their own role, and their"," ","Required role line lists both:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Listing a client's unpaid invoices: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INVC_R"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creating a quick payment link: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PAYLNK_C"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_ADMIN"]},"."]}]}]},"headings":[{"value":"Authentication & authorization","id":"authentication--authorization","depth":1},{"value":"The base role","id":"the-base-role","depth":2},{"value":"Roles","id":"roles","depth":2},{"value":"Endpoints that also accept API_ADMIN","id":"endpoints-that-also-accept-api_admin","depth":2}],"frontmatter":{"seo":{"title":"Authentication & authorization"}},"lastModified":"2026-11-13T17:58:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/reference/authorization","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}