Skip to content

Update a project

Request

Edits a project your organization owns after it was created — rename it, change its billing fields or budget, add leads and members, or remove leads and members. Requires the organization to be enabled for the write surface.

Every field is optional; send only what you want to change. name renames the project and can't be cleared. For billing_code, billing_office_name, and budget: a value sets it, null clears it, and omitting it leaves it untouched.

lead_emails and member_emails are add-only. Listed users are added with that role; anyone already on the project (in any role) is skipped, so re-sending is safe and never changes a role. An email junior has never seen receives a pending project invitation with the listed role; no account is created and no invitation email is sent. Re-adding a pending lead never downgrades it; adding a pending member as a lead promotes it. An explicit API assignment adopts any existing pending web invitation for that email and project into automatic acceptance on first web sign-in, preserving its token. Web invitations not assigned through the API still require explicit acceptance.

remove_member_emails removes people in any role, leads included. There is no separate remove_lead_emails field: to remove a lead, list their email in remove_member_emails. It also cancels matching pending invitations, lead or member. Removing the project creator hands creator ownership to the most recently added remaining lead, so a single call with the new lead in lead_emails and the old one in remove_member_emails transfers the project. If no other lead with an account remains, removing the creator is rejected with 400. An email can't appear in both an add list and remove_member_emails, and can't be in both lead_emails and member_emails — either is rejected with 400.

The response echoes the project's durable state after the edit, gated per field exactly like GET /v1/projects/{project_id}.

Security
bearerAuth
Path
project_idstring, (uuid)required
Bodyapplication/jsonrequired
non-empty
billing_codestring or null, <= 255 characters

Client-facing engagement/charge code. Send a value to set it, null to clear it, or omit to leave it unchanged.

billing_office_namestring or null, [ 1 .. 255 ] characters

Billing office by name (case-insensitive; must exist in your organization). Resolved server-side to the office and its billing policy. Send a value to set it, null to clear it, or omit to leave it unchanged. Rejected with 400 if a non-null name doesn't match an office.

budgetnumber or null, >= 0

Send a value to set it, null to clear it, or omit to leave it unchanged.

lead_emailsArray of strings, (email), <= 20 items

Users to ADD with the lead role. A never-seen email receives a pending LEAD project invitation; no account is created and no invitation email is sent. Adding a pending member as a lead promotes it, while a pending lead is never downgraded. Anyone already on the project is skipped.

member_emailsArray of strings, (email), <= 100 items

Users to ADD with the member role. An email junior has never seen receives a pending project invite (no account created — the person joins as a member on first sign-in). Anyone already on the project is skipped.

namestring, [ 1 .. 255 ] characters

New project name. Leading and trailing whitespace is trimmed. Can't be cleared: null or a blank name is rejected with 400.

remove_member_emailsArray of strings, (email), <= 100 items

Emails to REMOVE from the project, in any role: use this field for leads as well as members (there is no remove_lead_emails). Matching pending invitations are cancelled too, including for people who have never signed in. Removing the project creator hands creator ownership to the most recently added remaining lead; it is rejected with 400 when no other lead with an account remains. Unknown emails are ignored.

curl -i -X PATCH \
  'https://api.docs.junior.ai/_mock/openapi/projects/{project_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "billing_code": "string",
    "billing_office_name": "string",
    "budget": 0,
    "lead_emails": [
      "user@example.com"
    ],
    "member_emails": [
      "user@example.com"
    ],
    "name": "string",
    "remove_member_emails": [
      "user@example.com"
    ]
  }'

Responses

Project updated. Field availability depends on your organization's configuration — see the schema.

Bodyapplication/json
dataobject(ProjectDetail)required

A project read back via GET /v1/projects/{project_id}. Same fields as the create response, except that some sensitive fields may be omitted depending on your organization's configuration. An API key is an organization credential, so this can return a project nobody using that key created.

Response
{ "data": { "billing_code": "string", "billing_office_name": "string", "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "invited_lead_emails": [ … ], "invited_member_emails": [ … ], "is_archived": true, "lead_emails": [ … ], "member_emails": [ … ], "name": "string", "sector": "string" } }