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

# entities.leadOppty

Read lead oppty records with the leadOppty repository, and change them with the lead oppty mutations. Same records as the REST LeadOppties entity.

REST: [LeadOppties](https://developers.coevera.com/reference/rest/lead-oppties.md).

## Queries

- `getById(entityId: ID!): LeadOpptyEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [LeadOpptyEntity!]!` 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: LeadOpptyFilterInput, orderBy: [LeadOpptyOrderByInput!], includeDeleted: Boolean): [LeadOpptyEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: LeadOpptyFilterInput, orderBy: [LeadOpptyOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): LeadOpptyEntityConnection` Returns the records that match the filter as a cursor-paginated connection.
- `getChangedFieldsSinceRevision(id: UUID!, revision: Int!): [UUID!]!` Returns the ids of the fields of a record that changed after the given revision. Returns an empty list for entities without change tracking.

## Mutations

- `reactivateLeadOppty(input: ReactivateLeadOpptyInput!): ReactivateLeadOpptyPayload` Undo archive. GraphQL only.

## Types

### LeadOpptyEntity (object)

Lead or opportunity, with the fields both kinds of sales records share.

- `customFields: JSONString! (1 args)` Values of the record's custom fields as a JSON object keyed by custom field apiName (camelCase).
- `pendingScheduledActions: Int` Filled only when a single record is read by its id; otherwise null or an empty list.
- `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.
- `id: ID!` Unique identifier of entity.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.
- `fields: [InterfaceFieldData]! (2 args)` Values of the fields shown in the record's preview pane, as configured for the record's type.

### LeadOpptyEntityConnection (object)

Paginated list of LeadOppty records.

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

### LeadOpptyEntityEdge (object)

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

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

### LeadOpptyFilterInput (input)

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

- `OR: [LeadOpptyFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [LeadOpptyFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: LeadOpptyFilterInput` 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.
- `relatedEntities: [EntityFilterRelatedField]` Matches records related to at least one of the listed records.

### LeadOpptyOrderByInput (input)

Sorting of LeadOppty 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.
- `relatedEntities: CommonEntityRepositoryOrderByEntityRelationField` Sorts records by whether they are related to the listed records.

### ReactivateLeadOpptyInput (input)

Parameters of the reactivateLeadOppty mutation.

- `id: UUID!` Id of the archived lead or opportunity.
- `closingDate: Date` New expected closing date of a reactivated opportunity; when empty, the current closing date is kept. Not allowed for a lead.
- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).

### ReactivateLeadOpptyPayload (object)

Result of the reactivateLeadOppty mutation.

- `result: LeadOpportunityEntity` The reactivated lead or opportunity.
- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).

### LeadOpportunityEntity (union)

Either a lead or an opportunity.

LeadEntity | OpportunityEntity

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 FirstLeadOpptys {
  entities {
    leadOppty {
      getByCriteria(first: 3) {
        totalCount
        edges { node { id } }
      }
    }
  }
}
```

```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 FirstLeadOpptys { entities { leadOppty { getByCriteria(first: 3) { totalCount edges { node { id } } } } } }"}'
```
