Skip to content
LogoLogo

Project schema

See Management API schema for every domain, the endpoint and authentication.

Queries

project

Reads a project. Null when no project has the ID. Scope: ORGANIZATION_PROJECTS_READ.

project(input: ProjectInput!): Project @auth

projects

Lists the projects the user can reach, across every organization they belong to. search matches a case-insensitive substring of the name. Empty for an API key.

projects(organizationId: ID, first: Int, after: String, search: String, sortKey: ProjectSortKeys = NAME, reverse: Boolean = false): ProjectConnection! @auth

Mutations

projectCreate

Creates a project, with a draft workspace named Default. Scope: ORGANIZATION_PROJECTS_CREATE.

projectCreate(input: ProjectCreateInput!): ProjectCreatePayload! @auth

projectUpdate

Updates a project's name or brief. Scope: ORGANIZATION_PROJECTS_UPDATE.

projectUpdate(input: ProjectUpdateInput!): ProjectUpdatePayload! @auth

projectDelete

Deletes a project. Scope: ORGANIZATION_PROJECTS_DELETE.

projectDelete(input: ProjectDeleteInput!): ProjectDeletePayload! @auth

projectPreviewEnvironmentCreate

Creates a preview environment on a project. Invalid input comes back as userErrors. Scope: ORGANIZATION_PROJECTS_UPDATE.

projectPreviewEnvironmentCreate(input: ProjectPreviewEnvironmentCreateInput!): ProjectPreviewEnvironmentCreatePayload! @auth

projectPreviewEnvironmentUpdate

Updates a preview environment. Invalid input comes back as userErrors. Scope: ORGANIZATION_PROJECTS_UPDATE.

projectPreviewEnvironmentUpdate(input: ProjectPreviewEnvironmentUpdateInput!): ProjectPreviewEnvironmentUpdatePayload! @auth

projectPreviewEnvironmentDelete

Deletes a preview environment. An unknown ID comes back as userErrors. Scope: ORGANIZATION_PROJECTS_UPDATE.

projectPreviewEnvironmentDelete(input: ProjectPreviewEnvironmentDeleteInput!): ProjectPreviewEnvironmentDeletePayload! @auth

Types

ProjectSortKeys

"""The orders a project list can take. `reverse: true` flips the order."""
enum ProjectSortKeys {
  """By name, A to Z."""
  NAME
  """By creation time, oldest first."""
  CREATED_AT
  """By last change, oldest first."""
  UPDATED_AT
}

WorkspaceSortKeys

"""The orders a workspace list can take. `reverse: true` flips the order."""
enum WorkspaceSortKeys {
  """By name, A to Z."""
  NAME
  """By creation time, oldest first."""
  CREATED_AT
  """By the last change to the draft, oldest first."""
  DRAFT_CHANGED_AT
}

Project

"""
One site or one application. Each project has its own experiences, content and configuration,
and belongs to one organization.
"""
type Project {
  """The ID of the project."""
  id: ID!
  """The name of the project."""
  name: String!
  """The ID of the organization the project belongs to."""
  organizationId: ID!
  """When the project was created."""
  createdAt: DateTime!
  """When the project last changed."""
  updatedAt: DateTime!
  """
  The IANA time zone that analytics days follow, such as `America/New_York`. Set on create and
  fixed after.
  """
  timezone: String
  """
  The project brief in Markdown: audience, tone, goals, value propositions, entry points. Picked's
  AI agents read it. Null until set.
  """
  context: String
  """
  The analytics brief in Markdown: metric definitions, key events, segments, reporting conventions.
  Picked's AI agents read it when they query or explain analytics. Null until set.
  """
  analyticsContext: String
  """
  The project's Default Reports: for each area, its mode and whether its reports apply.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  defaultReports: DefaultReports! @auth
  """The organization the project belongs to."""
  organization: Organization!
  """
  The settings of the project, as key/value pairs.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  settings: [ProjectSetting!]!
  """
  The SDK presence recorded for the project. Null when none was recorded.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  sdkPresence: SdkPresence @deprecated(reason: "No SDK version records presence. Reads frozen rows; will be removed.")
  """
  The workspace whose version the project serves. Null until the first publish.
  Scope: `ORGANIZATION_WORKSPACE_READ`.
  """
  liveWorkspace: Workspace @auth
  """
  The version the project serves. Null until the first publish. After a restore it can be an
  earlier version than the latest. Read its contents with `workspaceDiff`.
  Scope: `ORGANIZATION_WORKSPACE_READ`.
  """
  liveWorkspaceVersion: WorkspaceVersion @auth
  """
  Every published version across the project's workspaces, newest first: the history a restore
  picks from. Versions of a deleted workspace are left out.
  Scope: `ORGANIZATION_WORKSPACE_READ`.
  """
  workspaceVersions(first: Int, after: String, last: Int, before: String): WorkspaceVersionConnection! @auth
  """
  The workspaces of the project. `search` matches a case-insensitive substring of the name;
  `status` keeps workspaces holding any listed status, and `totalCount` follows it. `HIDDEN`
  matches nothing.
  Scope: `ORGANIZATION_WORKSPACE_READ`.
  """
  workspaces(first: Int, after: String, last: Int, before: String, search: String, status: [WorkspaceStatus!], sortKey: WorkspaceSortKeys = CREATED_AT, reverse: Boolean = false): WorkspaceConnection! @auth
  """
  The reports on the project.
  Scope: `ORGANIZATION_REPORTS_READ`.
  """
  reports(first: Int, after: String, sortKey: ReportSortKeys = NAME, reverse: Boolean = false): ProjectReportConnection! @auth
  """
  The integrations installed on the project.
  Scope: `ORGANIZATION_INTEGRATIONS_READ`.
  """
  integrations: [Integration!]! @auth
  """
  The integration of a type. Null when it is not installed.
  Scope: `ORGANIZATION_INTEGRATIONS_READ`.
  """
  integration(type: IntegrationType!): Integration @auth
  """
  The third-party MCP servers registered to the project.
  Scope: `ORGANIZATION_INTEGRATIONS_READ`.
  """
  mcpServers(first: Int, after: String): McpServerConnection! @auth
  """
  The external APIs registered to the project: the origins its workflows may call.
  Scope: `ORGANIZATION_INTEGRATIONS_READ`.
  """
  externalApis(first: Int, after: String): ExternalApiConnection! @auth
  """
  The project's own labels, such as a counter or a lock, ordered by namespace then key. Expired
  labels are left out. Write them with `labelsSet` and `ownerType: PROJECT`.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  labels: [Label!]! @auth
  """
  The leads the project captured, newest first by default.
  Scope: `ORGANIZATION_LEADS_READ`.
  """
  leads(
    first: Int
    after: String
    last: Int
    before: String
    """
    A leads search query: a bare word matches the captured responses, and a
    search that is exactly a Picked ID matches that visitor's leads.
    `<namespace>.<key>`, a field key, `createdAt`, `pickedId`, or `session.<field>`
    addresses a label, a response, the capture time, the visitor's Picked ID, or
    the session the lead was captured in. `userId` is a deprecated name for
    `pickedId`. See
    https://docs.picked.app/reference/dashboard/lead-search.
    """
    query: String
    """
    The path to order by, in the grammar `query` uses: `labels.<namespace>.<key>`,
    `responses.<key>`, `id`, `pickedId` or `createdAt`. `userId` is a deprecated name for
    `pickedId`. A path naming nothing sortable orders by capture time. Leads with no value at the
    path sort last in either direction. A query with a `session.` clause orders by capture event
    and takes no sort or `createdAt` alone.
    """
    sort: String
    reverse: Boolean = true
    """
    The window, in the project's time zone, the leads were captured inside. `totalCount` and
    `metrics` count under it, and a metric measures over it unless given its own.
    """
    window: MetricWindowInput
    """
    How leads captured in one SDK session read. `SESSION` lists each session's newest matching
    lead alone, and `matchCount` and `metrics` count sessions. A query with a `session.` clause
    takes `NONE` alone.
    """
    collapse: LeadCollapse = NONE
  ): LeadConnection! @auth
  """
  The Leads reports on the project, in order: how leads are acquired, the journeys behind them,
  and how visits convert to leads. Each is a signed embed URL locked to the project, with an
  editable date range. Empty when the Leads Default Reports do not apply to the project.
  Scope: `ORGANIZATION_SESSIONS_READ`.
  """
  leadReports: [LeadReport!]! @auth
  """
  Suggests up to four leads searches for what was typed into a leads search box, each counted within
  the window. Requires the `lead-search-suggestions` feature flag.
  Scope: `ORGANIZATION_LEADS_READ`.
  """
  leadSearchSuggestions(
    """What was typed, at most 200 characters."""
    text: String!
    """
    The window, in the project's time zone, each suggestion is counted within.
    """
    window: MetricWindowInput
    """
    How a session's leads count. `SESSION` counts each session's newest matching lead once.
    """
    collapse: LeadCollapse = NONE
  ): [LeadSearchSuggestion!]! @auth
  """
  The Sessions reports on the project, in order: how its sessions arrive, the journeys they take,
  and which of them convert. Each is a signed embed URL locked to the project, with an editable
  date range. Empty when the Sessions Default Reports do not apply to the project.
  Scope: `ORGANIZATION_SESSIONS_READ`.
  """
  analyticsSessionsReports: [AnalyticsSessionsReport!]! @auth
  """
  Builds charts of unsaved Picked Analytics queries, each constructed by Picked Analytics as the
  caller's analytics user within two seconds. A chart it does not build is listed in `skipped`.
  Scope: `ORGANIZATION_REPORTS_READ`.
  """
  analyticsCharts(input: ProjectAnalyticsChartsInput!): AnalyticsCharts! @auth
  """
  One visitor session on the project's sites, across all of its events, anchored on its latest
  lead capture, else on its latest timeline event. Null when no event of it is recorded.
  Scope: `ORGANIZATION_SESSIONS_READ`.
  """
  analyticsSession(
    """The ID of the session."""
    id: ID!
  ): AnalyticsSession @auth
  """
  The visitor sessions on the project's sites, newest first by start. A session is its events
  inside `window`, and its `summary` adds up those events alone. `first` and `after` read older
  sessions, `last` and `before` newer ones, at most 100 a page. The newest events can take a few
  minutes to arrive.
  Scope: `ORGANIZATION_SESSIONS_READ`.
  """
  analyticsSessions(
    first: Int
    after: String
    last: Int
    before: String
    """
    The window, in the project's time zone, the sessions' events fall inside. Defaults to today
    and the six days before it.
    """
    window: MetricWindowInput
    """
    The sessions to keep, in the session search query language: the leads
    search grammar over a session. A bare word is a case-insensitive substring
    of a URL the session visited or landed on; `<field>:value`, `<field>~value`
    and `<field>:*` ask that some event of the session holds the value, a value
    containing it, or any value, for `gaid`, `utm_source`, `utm_medium`,
    `utm_campaign`, `utm_term`, `utm_content`, `page_url`, `page_origin`,
    `page_pathname`, `page_query`, `landing_page_url`, `landing_page_origin`,
    `landing_page_pathname` or `landing_page_query`; `location_country`,
    `location_country_code`, `location_region` and `location_city` ask the same
    of the session's location, equal in any case; each field is also written under `session.`; `lead:*` asks that the
    session captured a lead. A leading `-` negates a clause; clauses combine
    with AND, or with OR when the query says so, never both; at most ten.
    """
    query: String
    """Whether to include bots."""
    includeBots: Boolean = false
  ): AnalyticsSessionConnection! @auth
  """
  Suggests up to four session searches for what was typed into a sessions search box, each with
  how many sessions it keeps within the window. Requires the `lead-search-suggestions` feature flag.
  Scope: `ORGANIZATION_SESSIONS_READ`.
  """
  analyticsSessionSearchSuggestions(
    """What was typed, at most 200 characters."""
    text: String!
    """
    The window, in the project's time zone, each suggestion is counted within. Defaults to today
    and the six days before it.
    """
    window: MetricWindowInput
    """
    Whether each count keeps the sessions of bots, as `analyticsSessions` does.
    """
    includeBots: Boolean = false
  ): [AnalyticsSessionSearchSuggestion!]! @auth
  """
  The saved views of one of the project's lists, oldest first.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  savedViews(
    """The list to read the views of."""
    resource: SavedViewResource!
    first: Int
    after: String
    last: Int
    before: String
  ): SavedViewConnection! @auth
  """
  The preview environments of the project, oldest first.
  Scope: `ORGANIZATION_PROJECTS_READ`.
  """
  previewEnvironments: [ProjectPreviewEnvironment!]! @auth
}

ProjectPreviewEnvironment

"""
A named site with the SDK installed, such as Production or Staging, that a preview opens on.
"""
type ProjectPreviewEnvironment {
  """The ID of the preview environment."""
  id: ID!
  """The name of the preview environment, 1 to 40 characters."""
  label: String!
  """
  The origin or URL of the site. A preview opens it with a `picked-preview-token` query
  parameter.
  """
  url: String!
}

ProjectPreviewEnvironmentErrorCode

"""The validation errors of the preview environment operations."""
enum ProjectPreviewEnvironmentErrorCode {
  """No project has the ID."""
  PROJECT_NOT_FOUND
  """No preview environment has the ID."""
  ENVIRONMENT_NOT_FOUND
  """The label is empty."""
  LABEL_REQUIRED
  """The label is longer than 40 characters."""
  LABEL_TOO_LONG
  """The URL is empty."""
  URL_REQUIRED
  """The URL does not parse."""
  URL_INVALID
}

ProjectPreviewEnvironmentUserError

"""A validation error from a preview environment operation."""
type ProjectPreviewEnvironmentUserError {
  """The path to the input field at fault, such as `["label"]`."""
  field: [String!]
  """A message to show the user."""
  message: String!
  """The error code."""
  code: ProjectPreviewEnvironmentErrorCode!
}

ProjectPreviewEnvironmentCreateInput

"""The input of `projectPreviewEnvironmentCreate`."""
input ProjectPreviewEnvironmentCreateInput {
  """The ID of the project."""
  projectId: ID!
  """The name of the preview environment, 1 to 40 characters."""
  label: String!
  """
  The origin or URL of the site. Without a protocol, `https://` is assumed.
  """
  url: String!
}

ProjectPreviewEnvironmentCreatePayload

"""The result of `projectPreviewEnvironmentCreate`."""
type ProjectPreviewEnvironmentCreatePayload {
  """
  The created preview environment. Null when the input failed validation.
  """
  environment: ProjectPreviewEnvironment
  """The validation errors. Empty on success."""
  userErrors: [ProjectPreviewEnvironmentUserError!]!
}

ProjectPreviewEnvironmentUpdateInput

"""
The input of `projectPreviewEnvironmentUpdate`. Every field is required.
"""
input ProjectPreviewEnvironmentUpdateInput {
  """The ID of the preview environment."""
  id: ID!
  """The name of the preview environment, 1 to 40 characters. Required."""
  label: String!
  """The origin or URL of the site. Required."""
  url: String!
}

ProjectPreviewEnvironmentUpdatePayload

"""The result of `projectPreviewEnvironmentUpdate`."""
type ProjectPreviewEnvironmentUpdatePayload {
  """
  The updated preview environment. Null when the input failed validation.
  """
  environment: ProjectPreviewEnvironment
  """The validation errors. Empty on success."""
  userErrors: [ProjectPreviewEnvironmentUserError!]!
}

ProjectPreviewEnvironmentDeleteInput

"""The input of `projectPreviewEnvironmentDelete`."""
input ProjectPreviewEnvironmentDeleteInput {
  """The ID of the preview environment."""
  id: ID!
}

ProjectPreviewEnvironmentDeletePayload

"""The result of `projectPreviewEnvironmentDelete`."""
type ProjectPreviewEnvironmentDeletePayload {
  """
  The ID of the deleted preview environment. Null when the input failed validation.
  """
  deletedEnvironmentId: ID
  """The validation errors. Empty on success."""
  userErrors: [ProjectPreviewEnvironmentUserError!]!
}

ProjectSetting

"""One setting of a project. The shape of `value` depends on `key`."""
type ProjectSetting {
  """The key of the setting."""
  key: String!
  """The value of the setting."""
  value: JSON!
}

SdkPresence

"""
The SDK presence recorded for a project. The records are frozen: `lastSeenAt` is the last boot
recorded while tracking ran, not whether the SDK is reaching Picked today.
"""
type SdkPresence {
  """The ID of the project."""
  projectId: ID!
  """When the SDK was last seen booting. Null when unknown."""
  lastSeenAt: DateTime
  """Always null."""
  sdkVersion: String
  """Always null."""
  environment: String
}

ProjectEdge

"""A project in a page of results."""
type ProjectEdge {
  """The cursor of this edge."""
  cursor: String!
  """The project."""
  node: Project!
}

ProjectConnection

"""A page of projects."""
type ProjectConnection {
  """The edges in this page."""
  edges: [ProjectEdge!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """The total number of projects."""
  totalCount: Int!
}

ProjectInput

"""The input of `project`."""
input ProjectInput {
  """The ID of the project."""
  id: ID!
}

AnalyticsDataResidency

"""Where a project's analytics data is kept."""
enum AnalyticsDataResidency {
  """Kept in Australia, with workflows run in Sydney."""
  AUSTRALIA
  """Kept in the United States, with workflows run in Portland."""
  UNITED_STATES
}

ProjectCreateInput

"""The input of `projectCreate`."""
input ProjectCreateInput {
  """The name of the project. Must not be blank."""
  name: String!
  """The ID of the organization to create the project in."""
  organizationId: ID!
  """
  The IANA time zone that analytics days follow, such as `America/New_York`. Fixed after.
  """
  timezone: String!
  """
  Where the project's analytics data is kept and its workflows run. Fixed after. Omit it for
  `UNITED_STATES`.
  """
  analyticsDataResidency: AnalyticsDataResidency
}

ProjectCreatePayload

"""The result of `projectCreate`."""
type ProjectCreatePayload {
  """The created project."""
  project: Project
}

DefaultReports

"""
The built-in Leads and Sessions reports Picked Analytics keeps for every project, and which of them
apply to one project.
"""
type DefaultReports {
  """
  The Leads reports: how leads are acquired, the journeys behind them and how visits convert.
  """
  leads: DefaultReportsArea!
  """
  The Sessions reports: how sessions arrive, the journeys they take and which of them convert.
  """
  sessions: DefaultReportsArea!
}

DefaultReportsArea

"""
One area of a project's Default Reports: its mode and whether its reports apply.
"""
type DefaultReportsArea {
  """The mode the project sets for the area."""
  mode: DefaultReportsMode!
  """Whether the area's reports apply to the project."""
  applies: Boolean!
}

DefaultReportsMode

"""Whether an area of the Default Reports applies to a project."""
enum DefaultReportsMode {
  """Applies once the project holds a lead. Leads only."""
  AUTOMATIC
  """Always applies."""
  ON
  """Never applies."""
  OFF
}

DefaultReportsInput

"""
The input of `projectUpdate`'s `defaultReports`. Omit a field to keep its value.
"""
input DefaultReportsInput {
  """The Leads mode."""
  leads: DefaultReportsMode
  """The Sessions mode. `AUTOMATIC` is rejected."""
  sessions: DefaultReportsMode
}

ProjectUpdateInput

"""The input of `projectUpdate`. Omit a field to keep its value."""
input ProjectUpdateInput {
  """The ID of the project."""
  id: ID!
  """The name of the project. Must not be blank."""
  name: String
  """The project brief in Markdown. An empty string clears it."""
  context: String
  """The project analytics brief in Markdown. An empty string clears it."""
  analyticsContext: String
  """The modes of the project's Default Reports."""
  defaultReports: DefaultReportsInput
}

ProjectUpdatePayload

"""The result of `projectUpdate`."""
type ProjectUpdatePayload {
  """The updated project."""
  project: Project
}

ProjectDeleteInput

"""The input of `projectDelete`."""
input ProjectDeleteInput {
  """The ID of the project."""
  id: ID!
}

ProjectDeletePayload

"""The result of `projectDelete`."""
type ProjectDeletePayload {
  """The ID of the deleted project."""
  deletedProjectId: ID
}