---
title: entities.opportunityType
description: Read opportunity type records with the opportunityType repository, and change them with the opportunity type mutations. Same records as the REST OpportunityTypes entity.
canonical: https://developers.coevera.com/reference/graphql/opportunity-type/
section: graphql
verification: schema
generatedFrom: schema f155746 (2026-10-20)
publisher: Coevera
---

# entities.opportunityType

Read opportunity type records with the opportunityType repository, and change them with the opportunity type mutations. Same records as the REST OpportunityTypes entity.

REST: [OpportunityTypes](https://developers.coevera.com/reference/rest/opportunity-types.md).

## Queries

- `getById(entityId: ID!): OpportunityTypeEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [OpportunityTypeEntity!]!` Returns the records with the given ids; ids without a record are left out. Deleted records are returned as well.
- `getAll(limit: Int, offset: Int, filter: OpportunityTypeFilterInput, orderBy: [OpportunityTypeOrderByInput!], includeDeleted: Boolean): [OpportunityTypeEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: OpportunityTypeFilterInput, orderBy: [OpportunityTypeOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): OpportunityTypeEntityConnection` Returns the records that match the filter as a cursor-paginated connection.
- `getPublished(limit: Int, offset: Int, filter: OpportunityTypeFilterInput, orderBy: [OpportunityTypeOrderByInput!], includeDeleted: Boolean): [OpportunityTypeEntity!]!` Returns the published records that match the filter, paged with limit and offset.
- `getDrafts(filter: OpportunityTypeFilterInput, orderBy: [OpportunityTypeOrderByInput!]): [OpportunityTypeEntity!]!` Returns the records that match the filter, with pending unpublished changes applied where a draft exists.
- `getDraftById(entityId: ID!): OpportunityTypeEntity!` Returns the record with the given id, with its pending unpublished changes applied when a draft exists.
- `getByPipeline(pipelineId: UUID!): OpportunityTypeEntity` Returns the opportunity type that uses the given pipeline, or null when none does.

## Types

### OpportunityTypeEntity (object)

Opportunity type that classifies opportunities and defines their forms (edit, qualify, won and lost).

- `id: ID!` Unique identifier of entity.
- `isDeleted: Boolean` Specifies if the entity is considered deleted.
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `pipeline: PipelineEntity` Pipeline this opportunity type drives. Each opportunity type maps to exactly one pipeline.
- `formEdit: JSONString!` JSON definition of the form layout used by the UI when creating or editing opportunities of this type. This payload conforms to the `Form` JSON Schema: GET /api/v100/rest/schemas/Form.json on your region's API host
- `formLost: JSONString!` JSON definition of the form shown when archiving (losing) an opportunity of this type. Used to capture reason of close and any required closing fields. This payload conforms to the `Form` JSON Schema: GET /api/v100/rest/schemas/Form.json on your region's API host
- `formQualify: JSONString!` JSON definition of the form shown when qualifying a lead into an opportunity of this type.
- `formWon: JSONString!` JSON definition of the form shown when winning an opportunity of this type. Used to capture won-deal fields.
- `isReadonly: Boolean!` True when the opportunity type is system-managed and cannot be edited or deleted by users.
- `name: String!` Name of the entity and its default text representation.
- `pipelineId: ID!` Id of the pipeline this opportunity type drives.
- `settings: EntityTypeSettings!` Per-type configuration for records of this entity type, e.g. allowed task and appointment types that may be linked to records of this type. This payload conforms to the `EntityTypeSettings` JSON Schema: GET /api/v100/rest/schemas/EntityTypeSettings.json on your region's API host
- `isPublished: Boolean` True when the entity configuration is published; false while it exists only as an unpublished draft.
- `revision: Int` Revision when entity was lastly changed.
- `hasDraft: Boolean` True when the record has unpublished draft changes, including pending translation changes, that can be published.
- `isDeleteProtected: Boolean!` True when the record is protected against deletion because it must always exist in the space. Deleting a record that is not protected can still fail on other checks. Read-only.
- `formEditApi: Form` Typed, read-only view of a form layout of this type: formEditApi mirrors the edit form (formEdit), formLostApi the form shown when archiving as lost (formLost).
- `canChangeReadonly: Boolean` False for types whose read-only setting is fixed, such as the recurrent appointment type; true otherwise.
- `formLostApi: Form` Typed, read-only view of a form layout of this type: formEditApi mirrors the edit form (formEdit), formLostApi the form shown when archiving as lost (formLost).
- `formQualifyApi: [UUID]` Ids of the fields shown on the form when a lead is qualified into an opportunity of this type. Read-only view of `formQualify`.
- `formWonApi: [UUID]` Ids of the fields shown on the form when an opportunity of this type is won. Read-only view of `formWon`.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.

### OpportunityTypeEntityConnection (object)

Paginated list of OpportunityType records.

- `pageInfo: PageInfo!` Pagination data for this connection.
- `edges: [OpportunityTypeEntityEdge]!` Contains the nodes in this connection.
- `totalCount: Int` Total number of items in the connection.

### OpportunityTypeEntityEdge (object)

A Relay edge containing a `OpportunityTypeEntity` and its cursor.

- `node: OpportunityTypeEntity` The item at the end of the edge
- `cursor: String!` A cursor for use in pagination

### OpportunityTypeFilterInput (input)

Filter conditions for OpportunityType records. Conditions on different fields are combined with AND; use OR, AND and NOT for other combinations.

- `OR: [OpportunityTypeFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [OpportunityTypeFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: OpportunityTypeFilterInput` Matches records that do not meet this filter.
- `globalSearchQuery: String` Search term matched against the fields that the global search covers for this entity.
- `id: EntityFilterStringField` Unique identifier of entity.
- `isDeleted: Boolean` Specifies if the entity is considered deleted.
- `modified: EntityFilterDateTimeField` Last modification time.
- `created: EntityFilterDateTimeField` Creation time.
- `isReadonly: Boolean` True when the opportunity type is system-managed and cannot be edited or deleted by users.
- `name: EntityFilterStringField` Name of the entity and its default text representation.
- `pipelineId: EntityFilterStringField` Id of the pipeline this opportunity type drives.
- `isPublished: Boolean` True when the entity configuration is published; false while it exists only as an unpublished draft.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `pipeline: PipelineFilterInput` Pipeline this opportunity type drives. Each opportunity type maps to exactly one pipeline. Matches records where a related record meets these conditions.

### OpportunityTypeOrderByInput (input)

Sorting of OpportunityType records. Set exactly one field in each item; list several items to sort by more fields, in order of priority.

- `id: OrderByEnum` Unique identifier of entity.
- `isDeleted: OrderByEnum` Specifies if the entity is considered deleted.
- `modified: OrderByEnum` Last modification time.
- `created: OrderByEnum` Creation time.
- `pipeline: [PipelineOrderByNestedInput!]` Pipeline this opportunity type drives. Each opportunity type maps to exactly one pipeline. Sorts by fields of the related record, listed in order of priority.
- `isReadonly: OrderByEnum` True when the opportunity type is system-managed and cannot be edited or deleted by users.
- `name: OrderByEnum` Name of the entity and its default text representation.
- `pipelineId: OrderByEnum` Id of the pipeline this opportunity type drives.
- `isPublished: OrderByEnum` True when the entity configuration is published; false while it exists only as an unpublished draft.
- `revision: OrderByEnum` Revision when entity was lastly changed.

Types several repositories share, such as `PageInfo` and the filter fields, are in the [types index](https://developers.coevera.com/reference/graphql/types.md). The [SDL](https://developers.coevera.com/graphql/schema.graphql) has the whole schema in one file.

## Example

```graphql
query FirstOpportunityTypes {
  entities {
    opportunityType {
      getByCriteria(first: 3, orderBy: [{ modified: Desc }]) {
        totalCount
        edges { node { id name modified } }
      }
    }
  }
}
```

```bash
curl 'https://{region}.api.coevera.com/api/v100/app/space/{space_id}/graphql/public' \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '{"query":"query FirstOpportunityTypes { entities { opportunityType { getByCriteria(first: 3, orderBy: [{ modified: Desc }]) { totalCount edges { node { id name modified } } } } } }"}'
```
