Skip to main content
This walkthrough takes an organization from sign-up to a service-account key your servers can call Priors with. Do it once per product. Steps 1 to 5 happen in the Priors app; steps 6 and 7 are API calls.

Step 1: sign up

Sign up at app.sapientpriors.com. Priors approves new organizations, and then you can sign in. The first person in an organization is its Org admin.

Step 2: create a project

Create one project per product, for example Meeting notes and Knowledge base. Open Projects and choose New project. Give it a name, and pick at least one Project admin. You are picked by default. Every organization also has a Default project. You can leave it empty.

Step 3: add your team

Open the project’s Members page and choose Add people. Enter each person’s email and pick a role:
  • Project admin for the engineers who build the product. They can create agents, service accounts, and keys in this project.
  • Agent admin for people who teach a few chosen agents. Pick the agents in the same dialog.
  • Contributor for everyone else. They can chat with every public agent in the project.
An email outside your organization gets an invitation. The person joins the organization and the project when they accept it. See Roles and permissions.

Step 4: create a service account and its key

A service account runs your product in production. Its keys keep working when people leave. On the project’s API keys page, choose Create key:
  1. Name the key, for example notes-prod, and pick how long it lasts. 365 days is the default.
  2. Tick Mark as service account key, and pick its role:
    • Project admin if your code creates and deletes agents, uploads and deletes files, and deletes memories. Most products need this.
    • Agent admin or Contributor if your code only uses agents that someone creates by hand.
  3. Choose Generate key, and copy the key.
  • The secret is shown once. Put it straight into your secret manager.
  • Note the expiry date and plan the rotation. An expired key returns 401 with no advance warning.
  • Create one service-account key for each environment, for example one for production and one for staging.
See Service accounts.

Step 5: give engineers their own keys

Engineers who test from their own machine create a personal key on the same page: Create key, leave Mark as service account key unticked, and confirm For building and testing, not production. A personal key cannot act for your customers. See Authentication.

Step 6: check the key

Success: status 200. api_key.acts_as.type is service_account, and api_key.project_id is the project you created.
If it fails: 401 unauthorized means the key is wrong, revoked, or expired. 400 invalid_request means the request carried Sec-Fetch-Site: call Priors from your server, never from a browser.

Step 7: create your first agent

Success: status 202, with status: "initializing". The agent lives in the key’s project and is public, so it shows on the project’s Agents page. Poll GET/v2/agents/ every second until status is ready. If it fails: 403 forbidden means the service account’s role cannot create agents: give it the Project admin role. 409 agent_quota_exceeded means the organization holds its maximum of live agents.

Next