# Filter jobs

```http
POST https://secure.yoprint.com/v1/api/store/{team_slug}/job/filter
```

- API version: v1
- Operation ID: `v1_public_job_filter`
- Section: Production › [Jobs](https://developer.yoprint.com/reference/jobs.md)
- Web page: https://developer.yoprint.com/reference/jobs/v1-job-filter/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns one page of your team's jobs that match the filters, in the order you ask for.

Only jobs on sales orders are listed: quotes, drafts and deleted jobs are left out. Each job is the full job (as in Get one job of an order) without `services`, `pipelines` and `pending_approval`; `mockup` and `production_file` are included.

Every condition in `filters` must match (they are joined with AND). Omit `filters` for no filter; an empty array is a 422. A `key` that isn't in the table, a missing `operator` or `value`, or a value of the wrong kind fails the whole request with 422; the message for `filters` (or `sort`) is the bare rule name `validation.filter_rule` (or `validation.filter_sort_rule`), with no detail, so check each filter against the table. Send real values: no key here matches empty columns with `"null"` or `""` (for dates, use the `..._is_set` keys where the table has them). Hash ids in `value` are decoded for you. `system-current-user` stands for the caller only where a key's row says so; elsewhere it is compared as a raw value, so with `in` it matches nothing and with `nin` it matches every row that has a value.

| `key` | Kind | Operators and `value` | Meaning |
| --- | --- | --- | --- |
| `status_id` | Hash ids | `in` or `nin`, with an array of hash ids. | The job status (hash ids from List job statuses). |
| `status_type` | Options | `in` or `nin`, with an array of the listed values. | The kind of status: `start` (Pending), `pre_production` or `in_progress` (In Progress), `end` (Completed). |
| `is_rush` | Yes or no | `eq` or `neq`, with `true` or `false`. | Rush jobs. |
| `start_date` | Date | `eq`, `gte` or `lte`, with a whole number of days counted from now (UTC). See below. | The job's start date. |
| `due_date` | Date | `eq`, `gte` or `lte`, with a whole number of days counted from now (UTC). See below. | The job's due date. |
| `start_date_is_set` | Yes or no | `eq` or `neq`, with `true` or `false`. | The job has a start date (`eq true`) or none (`eq false`). Use `eq` only: any `neq` means "has the date". |
| `due_date_is_set` | Yes or no | `eq` or `neq`, with `true` or `false`. | The job has a due date (`eq true`) or none (`eq false`). Use `eq` only: any `neq` means "has the date". |
| `need_cust_provide_product` | Yes or no | `eq` or `neq`, with `true` or `false`. | Blanks are provided by the customer. |
| `job_has_pipelines` | Hash ids | `in` or `nin`, with an array of hash ids. | The job has a task from one of these task presets. With `nin` it matches jobs that have a task from a preset outside the list, not jobs without those presets. |
| `has_any_pipelines` | Yes or no | `eq` or `neq`, with `true` or `false`. | The job has at least one task. The operator and value aren't read: it always means "has a task". |
| `status_last_change_date` | Date | `eq`, `gte` or `lte`, with a whole number of days counted from now (UTC). See below. | When the status last changed. |
| `status_completion_date` | Date | `eq`, `gte` or `lte`, with a whole number of days counted from now (UTC). See below. | When the job reached a Completed status. |
| `total_qty_need_ordering` | Number | `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, with a number. | The quantity that still needs ordering. |
| `order_created_by` | Hash ids | `in` or `nin`, with an array of hash ids. | Who created the sales order (user hash ids). `system-current-user` is not supported here: with `in` it matches nothing, with `nin` everything. |
| `search` | Text search | Any operator (`ct` reads best). The value must not be empty. | Job name, job number (`JOB-2419`, `2419` and `#2419` all match), order number, order name, customer PO and customer name. Every one of the first five words must match. |

A date filter's `value` is a whole number of days, counted from the moment of the request in UTC: `eq` N matches the whole UTC day N days from today (0 is today, -1 yesterday); `gte` N matches dates on or after now plus N days; `lte` N matches dates on or before now **minus** N days. So "due in the next 7 days" is `due_date gte 0` and `due_date lte -7`, and "overdue" is `due_date lte 0`. This differs from the v2 filters (Filter invoices, the production control calendar), where `lte` and `gte` both count forward.

The response is one page with `pagination`. The page size is the team's list page size setting (50 unless the team changed it); `per_page` is not read. Send `page` (from 1) in the body or the query string for later pages.

## Permission

Any member of the team. No sales order permission is checked.

## Business rules

- Status types are `start` (Pending), `pre_production` and `in_progress` (In Progress), and `end` (Completed).
- A sort `key` that isn't listed, or a `direction` other than `asc` or `desc`, is a 422.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.

## Request body

Content type `application/json`, optional.

Fields:

- `filters` (array of objects, optional): Conditions, all of which must match. Omit for no filter. At least 1 item.
  - Each item:
    - `key` (string, required): What to filter on. See the table in the description. One of: `"status_id"`, `"status_type"`, `"is_rush"`, `"start_date"`, `"due_date"`, `"start_date_is_set"`, `"due_date_is_set"`, `"need_cust_provide_product"`, `"job_has_pipelines"`, `"has_any_pipelines"`, `"status_last_change_date"`, `"status_completion_date"`, `"total_qty_need_ordering"`, `"order_created_by"`, `"search"`.
    - `operator` (string, required): How to compare. Each kind of key accepts only some operators. One of: `"eq"`, `"neq"`, `"gt"`, `"gte"`, `"lt"`, `"lte"`, `"in"`, `"nin"`, `"bt"`, `"ct"`, `"sw"`, `"ew"`.
    - `value` (string | number | boolean | array, required): What to compare with: text, a number of days, true or false, or an array of hash ids or options, by kind of key.
- `page` (integer, optional): The page to read. Default `1`. Minimum 1.
- `sort` (array of objects, optional): Sort keys, applied in order. Without `sort` the order is not guaranteed.
  - Each item:
    - `direction` (string, required): One of: `"asc"`, `"desc"`.
    - `key` (string, required): One of: `"id"`, `"due_date"`, `"order_id"`, `"status_id"`, `"start_date"`, `"impression_count"`, `"item_count"`, `"scoped_id"`, `"is_rush"`, `"position"`, `"status_last_change_date"`, `"status_completion_date"`, `"order_due_date"`, `"order_ship_due_date"`, `"order_cust_due_date"`, `"order_issue_date"`, `"total_qty_need_ordering"`, `"order_ship_due_date_undated_last"`, `"created_at_id"`.

### Example request

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/job/filter' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "filters": [
      {
        "key": "status_type",
        "operator": "in",
        "value": [
          "start",
          "in_progress"
        ]
      },
      {
        "key": "due_date",
        "operator": "lte",
        "value": -7
      }
    ],
    "page": 1,
    "sort": [
      {
        "direction": "asc",
        "key": "due_date"
      }
    ]
  }'
```

## Response

`200` Successful response.

Fields:

- `data` (array of objects, required)
  - Each item:
    - `approval_ready_mockup_design_count` (integer, optional)
    - `assigned_users` (array of objects, optional): People on the job.
      - Each item:
        - `avatar_url` (string | null, optional)
        - `id` (string, optional): The user.
        - `name` (string, optional)
    - `auto_saved_for` (string | null, optional): Set only on autosave copies.
    - `customer` (object, optional)
      - `id` (string | null, optional): The customer.
      - `name` (string | null, optional)
    - `due_date` (string (date-time) | null, optional): Production due date. ISO 8601 with offset, or null.
    - `from_legacy` (boolean, optional)
    - `has_service` (boolean, optional): Kept for older clients; not a count of services.
    - `id` (string, optional): The job.
    - `impression_count` (number | null, optional)
    - `inventory_status` (string | null, optional): The stock status of the job's lines.
    - `is_rush` (boolean, optional)
    - `item_count` (number | null, optional): Units on the job.
    - `location_count` (number | null, optional)
    - `mockup` (array of objects, optional): Mockup files.
      - Each item:
        - `id` (string, optional): The file.
        - `name` (string | null, optional)
        - `url` (string | null, optional): Download link with its own access token.
    - `mockup_design_count` (integer, optional)
    - `mockup_summary` (object, optional)
      - `count` (integer, optional)
      - `has_mockups` (boolean, optional)
    - `name` (string | null, optional)
    - `need_cust_provide_product` (boolean | integer | null, optional): Blanks are provided by the customer.
    - `note` (string | null, optional)
    - `order_customer_po_number` (string | null, optional)
    - `order_id` (string, optional): The order.
    - `order_scoped_id` (string, optional): The order number.
    - `pdf` (array of objects, optional): PDF links.
      - Each item:
        - `label` (string, optional)
        - `url` (string (uri), optional): A download link that carries its own long-lived access token: don't publish it.
    - `position` (integer | null, optional)
    - `pricing_original_total` (decimal pair, optional): The job's price before pricing rules, at the stored scale. A decimal pair: the amount is `value` ÷ 10^`dp` (`{ "value": 1250, "dp": 2 }` is 12.50). Read `dp` every time: it can differ between fields and records. See https://developer.yoprint.com/concepts/money-and-quantities.md.
    - `pricing_rule_applied` (object | null, optional): The pricing rule that set the job's decoration price, or null. These answers usually carry only `type`, the two ids and the two totals. List the jobs of a sales order or quote and Get one job of a sales order or quote answer with the full summary (the rule's current name and position, the prices before and after).
      - `after` (string | null, optional): Full summary only: the price after the rule, as a decimal string.
      - `after_total` (decimal pair, optional): The decoration price after the rule. A decimal pair: the amount is `value` ÷ 10^`dp` (`{ "value": 1250, "dp": 2 }` is 12.50). Read `dp` every time: it can differ between fields and records. See https://developer.yoprint.com/concepts/money-and-quantities.md.
      - `base` (string | null, optional): Full summary only: the decoration price the rule started from, as a decimal string.
      - `base_type` (string | null, optional): Full summary only: `service_price`.
      - `normal_price` (string | null, optional): Full summary only: the price with no rule (the same as `base` for a job).
      - `original_total` (decimal pair, optional): The decoration price before the rule. A decimal pair: the amount is `value` ÷ 10^`dp` (`{ "value": 1250, "dp": 2 }` is 12.50). Read `dp` every time: it can differ between fields and records. See https://developer.yoprint.com/concepts/money-and-quantities.md.
      - `pricing_group_id` (string | null, optional): The pricing group.
      - `pricing_group_name` (string | null, optional): Full summary only: the group's name now.
      - `pricing_group_removed` (boolean | null, optional): Full summary only: true when the group was removed since. The job keeps its price.
      - `pricing_rule_id` (string | null, optional): The pricing rule.
      - `rule` (object | null, optional): Full summary only: the rule as the group holds it now (`id`, `label`, `position`, where 1 is the first rule checked), or null when it no longer exists.
      - `type` (string | null, optional): `service` on a job.
    - `pricing_total` (decimal pair, optional): The job's price, at the stored scale (usually 6 decimal places: `{ "value": 600000000, "dp": 6 }` is 600.00). A decimal pair: the amount is `value` ÷ 10^`dp` (`{ "value": 1250, "dp": 2 }` is 12.50). Read `dp` every time: it can differ between fields and records. See https://developer.yoprint.com/concepts/money-and-quantities.md.
    - `production_file` (array of objects, optional): Production files. Same fields as `data[].mockup` above.
    - `qr_code_url` (string | null, optional): A QR code image for the job.
    - `sales_order` (object, optional): A summary of the job's order.
      - `created_by` (string | null, optional): Who created the order.
      - `cust_due_date` (string (date-time) | null, optional): Order customer due (in-hand) date. ISO 8601 with offset, or null.
      - `due_date` (string (date-time) | null, optional): Order production due date. ISO 8601 with offset, or null.
      - `external_type` (string | null, optional): `shopify` when the order came from Shopify, else null.
      - `is_quote` (boolean, optional)
      - `is_rush` (boolean, optional)
      - `issue_date` (string (date-time) | null, optional): Order issue date. ISO 8601 with offset, or null.
      - `name` (string | null, optional): Order name.
      - `object_type` (string | null, optional): `sales_order` or `quote`.
      - `ship_due_date` (string (date-time) | null, optional): Order ship-by date. ISO 8601 with offset, or null.
      - `shopify_deleted_externally` (boolean, optional)
      - `shopify_deleted_externally_at` (string (date-time) | null, optional): When it was deleted in Shopify. ISO 8601 with offset, or null.
      - `start_date` (string (date-time) | null, optional): Order production start. ISO 8601 with offset, or null.
      - `status_id` (string | null, optional): The order status.
    - `scoped_id` (string, optional): The job number as shown, with its `JOB-` prefix. Change a job number takes only the digits.
    - `services_still_valid` (boolean, optional)
    - `start_date` (string (date-time) | null, optional): Production start. ISO 8601 with offset, or null.
    - `status` (object, optional): A status: label, kind and place in the list.
      - `color` (string | null, optional): Hex color.
      - `customer_label` (string, optional)
      - `id` (string, optional): The status.
      - `label` (string, optional)
      - `pipeline_id` (string, optional): Only on the statuses of a task preset (`role` `pipeline`): the task preset. Absent on other statuses.
      - `position` (integer, optional): Its place in the team's list: sort by it to find the next status.
      - `role` (string, optional): Which list it belongs to: `job` for job statuses, `pipeline` for the statuses of a task preset. One of: `"order"`, `"quote"`, `"job"`, `"purchase_order"`, `"shipment"`, `"customer_message"`, `"pipeline"`.
      - `trashed` (boolean, optional): The status was deleted.
      - `type` (string, optional): The kind of status: `start` (Pending), `pre_production` and `in_progress` (In Progress), `end` (Completed). One of: `"start"`, `"pre_production"`, `"in_progress"`, `"end"`.
    - `status_completion_date` (string (date-time) | null, optional): When it reached a Completed status. ISO 8601 with offset, or null.
    - `status_id` (string, optional): The job's current status: its production stage. Look it up in List job statuses, or read `status`.
    - `status_last_change_date` (string (date-time) | null, optional): When the status last changed. ISO 8601 with offset, or null.
    - `total_qty_need_ordering` (string | null, optional): Quantity that still needs ordering, with 8 decimal places (`"12.00000000"`). A decimal string, such as `"0.00000000"`; parse it as a decimal.
    - `unique_key` (string | null, optional): The job's unique key.
    - `version` (integer, optional)
- `status` (integer, required)
- `success` (boolean, required)
- `pagination` (object, optional)
  - `count` (integer, required)
  - `currentPage` (integer, required)
  - `links` (object | array of any, required): Links to the neighbouring pages: `previous` and `next`, each present only when that page exists. An empty list, `[]`, when there is only one page.
    - `next` (string (uri), optional): The next page.
    - `previous` (string (uri), optional): The previous page.
  - `perPage` (integer, required)
  - `total` (integer, required)
  - `totalPages` (integer, required)

Example response:

```json
{
  "data": [
    {
      "assigned_users": [],
      "auto_saved_for": null,
      "customer": {
        "id": "ifAHmADekGZ6id",
        "name": "Northwind Apparel"
      },
      "due_date": "2026-11-06T17:00:00+00:00",
      "id": "WaGvtaWsx7Kcn4",
      "is_rush": true,
      "item_count": 48,
      "mockup": [],
      "name": "Front print",
      "note": null,
      "order_id": "sFbALVSYD55eXe",
      "order_scoped_id": "SO1001",
      "pdf": [
        {
          "description": "Job details without mockup",
          "label": "Job Details",
          "url": "https://example.com/pdf/job-details.pdf"
        }
      ],
      "position": 1,
      "pricing_original_total": {
        "dp": 6,
        "value": 600000000
      },
      "pricing_rule_applied": null,
      "pricing_total": {
        "dp": 6,
        "value": 600000000
      },
      "production_file": [],
      "sales_order": {
        "is_quote": false,
        "is_rush": false,
        "name": "Team shirts",
        "object_type": "sales_order",
        "status_id": "wgbOT87gGZvhgy"
      },
      "scoped_id": "JOB-2419",
      "start_date": "2026-11-04T09:00:00+00:00",
      "status": {
        "color": "#2196f3",
        "customer_label": "In Progress",
        "id": "scaWHQnPLtqMPT",
        "label": "Printing",
        "position": 3,
        "role": "job",
        "trashed": false,
        "type": "in_progress"
      },
      "status_completion_date": null,
      "status_id": "scaWHQnPLtqMPT",
      "status_last_change_date": "2026-11-03T15:05:00+00:00",
      "total_qty_need_ordering": "0.00000000",
      "unique_key": "job_EXAMPLEuniqueKey"
    }
  ],
  "pagination": {
    "count": 1,
    "currentPage": 1,
    "links": [],
    "perPage": 50,
    "total": 1,
    "totalPages": 1
  },
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
- `422` The request was refused and changed nothing. `validation_failed` lists what to fix in `error.fields`; other codes name a business rule, explained in `error.message`. A few checks answer with only `{"message": "..."}`. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer `connect_timeout` ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.
  - When: A filter has an unknown `key`, a missing part, or an operator or value its kind doesn't accept; or `filters` is an empty array. Fix: Check each filter against the table. Leave `filters` out to read everything.

## Notes

- Status ids come from List job statuses; task preset ids from List task presets.

## Related

- [List jobs](https://developer.yoprint.com/reference/jobs/v1-job-index.md): `GET /v1/api/store/{team_slug}/job`
- [List jobs in a date range](https://developer.yoprint.com/reference/jobs/v1-job-calendar.md): `POST /v1/api/store/{team_slug}/job/calendar`
- [List job statuses](https://developer.yoprint.com/reference/statuses/v1-status-list-job.md): `GET /v1/api/store/{team_slug}/setting/status/job`
- [List task presets](https://developer.yoprint.com/reference/task-presets/v1-pipeline-index.md): `GET /v1/api/store/{team_slug}/setting/pipeline`
