diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index b489e3f..24af43d 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -1,3 +1,16 @@ +# Copyright 2026 Peanut Butter Unicorn LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. name: Test on: pull_request: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab0c18d..bd156e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,16 @@ +# Copyright 2026 Peanut Butter Unicorn LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. name: Release on: @@ -32,4 +45,4 @@ jobs: GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} GPG_FILE: ${{ secrets.GPG_FILE }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - run: ./gradlew publishToMavenCentral --info \ No newline at end of file + run: ./gradlew publishToMavenCentral --info diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1133129 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f40fd4..94e9acc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -259,7 +259,7 @@ A good way to summarize the 'testing commandments' is "If it's documented, [test ```java /** - * {@summary List Locales} + *

{@summary List Locales}

* Lists the translation locales available for the account. Allowed for anyone * * @return Success response (status code 200) diff --git a/build.gradle.kts b/build.gradle.kts index 51ef51a..7c73844 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,18 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED @@ -9,7 +24,6 @@ plugins { id("signing") id("com.gradleup.nmcp.aggregation").version("1.4.4") id("io.micronaut.library") version "4.6.2" - id("io.micronaut.openapi") version "4.6.2" id("jacoco") id("org.sonarqube") version "latest.release" } @@ -60,21 +74,6 @@ micronaut { incremental(true) annotations("lol.pbu.*") } - openapi { - version = "6.20.0" - client(file("src/main/resources/z4j.yaml")) { - apiPackageName.set("lol.pbu.z4j.client") - modelPackageName.set("lol.pbu.z4j.model") - useReactive.set(true) - useAuth.set(false) - lombok.set(true) - clientId.set("zendesk") - apiNameSuffix.set("Client") - alwaysUseGenerateHttpResponse.set(false) - generateHttpResponseWhereRequired.set(false) - additionalProperties.put("retryable", "true") - } - } } sonarqube { @@ -125,7 +124,7 @@ publishing { } developers { developer { - id.set("jonathan-zollinger") + id.set("Jonathan-Zollinger") name.set("Jonathan Zollinger") email.set("jonathan.zollinger@gmail.com") } @@ -158,3 +157,4 @@ nmcpAggregation { } publishAllProjectsProbablyBreakingProjectIsolation() } + diff --git a/gradle/asciidoc.gradle b/gradle/asciidoc.gradle index 57bee87..a776c3c 100644 --- a/gradle/asciidoc.gradle +++ b/gradle/asciidoc.gradle @@ -1,3 +1,18 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ asciidoctorj { version '2.1.0' modules { @@ -21,3 +36,4 @@ asciidoctorj { "revnumber": "$project.version" } + diff --git a/settings.gradle.kts b/settings.gradle.kts index f7efaf1..54a5dfc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,16 @@ -rootProject.name = "z4j" \ No newline at end of file +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +rootProject.name = "z4j" diff --git a/src/main/java/lol/pbu/z4j/client/ArticleClient.java b/src/main/java/lol/pbu/z4j/client/ArticleClient.java new file mode 100644 index 0000000..f9b0197 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/ArticleClient.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.PathVariable; +import io.micronaut.http.annotation.QueryValue; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lol.pbu.z4j.model.ArticlesResponse; +import lol.pbu.z4j.model.LocaleAbbreviation; +import lol.pbu.z4j.model.SortArticleBy; +import lol.pbu.z4j.model.SortOrder; +import reactor.core.publisher.Mono; + +/** + *

{@summary Work with Articles in Zendesk.}

+ * + * + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ + +@Retryable +@Client("zendesk") +public interface ArticleClient { + + /** + *

{@summary List Articles}

+ * + * @param localeAbbreviation The locale in which the article is displayed. (must be lowercase, even if zendesk returns a mixed case response) (required) + * @param sortBy Sorts the articles by one of the accepted values (optional) + * @param sortOrder Selects the order of the results. (optional) + * @param startTime You can use the incremental article endpoint to list all the articles that were updated since a certain date and time. + * This time is given as a Unix epoch timeStamp (optional) + * @param labelNames Only articles that have all the labels are returned. Multiple labels can be passed in a comma-delimited string (optional) + * @return OK Response (status code 200) + */ + @Get("/api/v2/help_center/{locale}/articles") + Mono<@Valid ArticlesResponse> listArticles( + @PathVariable("locale") @NotNull LocaleAbbreviation localeAbbreviation, + @QueryValue("sort_by") @Nullable SortArticleBy sortBy, + @QueryValue("sort_order") @Nullable SortOrder sortOrder, + @QueryValue("start_time") @Nullable Long startTime, + @QueryValue("label_names") @Nullable String labelNames + ); +} diff --git a/src/main/java/lol/pbu/z4j/client/BasicAuthFilter.java b/src/main/java/lol/pbu/z4j/client/BasicAuthFilter.java index adae021..d10ae1d 100644 --- a/src/main/java/lol/pbu/z4j/client/BasicAuthFilter.java +++ b/src/main/java/lol/pbu/z4j/client/BasicAuthFilter.java @@ -1,3 +1,18 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package lol.pbu.z4j.client; import io.micronaut.context.annotation.Property; @@ -13,7 +28,6 @@ /** * Add a basic auth to anything * - * @author Jonathan Zollinger * @since 0.0.1 */ @@ -34,7 +48,7 @@ public class BasicAuthFilter { * @param token api token generated from z4j */ public BasicAuthFilter(@Property(name = "micronaut.http.services.zendesk.email") String email, - @Property(name = "micronaut.http.services.zendesk.token") String token){ + @Property(name = "micronaut.http.services.zendesk.token") String token) { this.email = email; this.token = token; } @@ -47,3 +61,4 @@ public void doFilter(MutableHttpRequest request) { request.header("Content-Type", "application/json"); } } + diff --git a/src/main/java/lol/pbu/z4j/client/CategoryClient.java b/src/main/java/lol/pbu/z4j/client/CategoryClient.java new file mode 100644 index 0000000..bf9e456 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/CategoryClient.java @@ -0,0 +1,206 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.*; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lol.pbu.z4j.model.*; +import reactor.core.publisher.Mono; + +/** + *

Work with Categories in Zendesk.

+ * + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Retryable +@Client("zendesk") +public interface CategoryClient { + + /** + *

{@summary Create Category by Locale}

+ *

You must specify a category name and locale. + * Though the Zendesk Api states you can create multiple translations at this time, in practice this doesn't work.

+ *

Allowed for Help Center managers

+ * + * NOTE: pagination is not currently supported + * + * @param localeAbbreviation The in which the item is displayed. (must be lowercase, even if returned from zendesk as mixed case) (required) + * @param createCategoryRequest The locale can be omitted from the createCategoryRequest. (required) + * @return Created response (status code 201) + */ + @Post("/api/v2/help_center/{locale}/categories") + Mono<@Valid CategoryResponse> createCategory( + @PathVariable("locale") @NotNull LocaleAbbreviation localeAbbreviation, + @Body @NotNull @Valid CreateCategoryRequest createCategoryRequest + ); + + /** + *

{@summary Create Category}

+ *

You must specify a category name and locale. + * Though the Zendesk Api states you can create multiple translations at this time, in practice this doesn't work.

+ *

Allowed for Help Center managers

+ * + * NOTE: pagination is not currently supported + * + * @param createCategoryRequest The locale cannot be omitted from this createCategoryRequest. (required) + * @return OK Response (status code 201) + */ + @Post("/api/v2/help_center/categories") + Mono<@Valid CategoryResponse> createCategoryNoLocale(@Body @Valid CreateCategoryRequest createCategoryRequest); + + /** + *

{@summary Delete Category by Locale}

+ *

WARNING: Every section and all articles in the category will also be deleted.

+ *

Allowed for Help Center managers

+ * + * @param localeAbbreviation The locale the item is displayed in. (must be lowercase, even if returned from zendesk as mixed case) (required) + * @param categoryId The unique ID of the category (required) + * @return No content (status code 204) + */ + @Delete("/api/v2/help_center/{locale}/categories/{category_id}") + Mono deleteCategory(@PathVariable("locale") @NotNull LocaleAbbreviation localeAbbreviation, @PathVariable("category_id") @NotNull Long categoryId); + + /** + *

{@summary Delete Category}

+ *

WARNING: Every section and all articles in the category will also be deleted.

+ *

Allowed for Help Center managers

+ * + * @param categoryId The unique ID of the category (required) + * @return

No content

(status code 204) + */ + @Delete("/api/v2/help_center/categories/{category_id}") + Mono deleteCategoryNoLocale(@PathVariable("category_id") @NotNull Long categoryId); + + /** + *

{@summary List Categories by Locale}

+ *

The response will list only the categories that the agent, end user, or anonymous user can view in the help center.

+ *

Translations are embedded within the category because they're not shared between resources.

+ *

Allowed for Anonymous users

+ * + * @param localeAbbreviation The locale the item is displayed in. (must be lowercase, even if returned from zendesk as mixed case) (required) + * @param sortBy {@link SortCategoryBy} (optional) + * @param sortOrder {@link SortOrder} (optional) + * @return OK (status code 200) + */ + @Get("/api/v2/help_center/{locale}/categories") + Mono<@Valid CategoriesResponse> listCategories( + @PathVariable("locale") @NotNull LocaleAbbreviation localeAbbreviation, + @QueryValue("sort_by") @Nullable SortCategoryBy sortBy, + @QueryValue("sort_order") @Nullable SortOrder sortOrder + ); + + /** + *

{@summary List Categories}

+ * Allowed for Agents

The response will list only the categories that the agent can view in the help center.

+ * + * @param sortBy {@link SortCategoryBy} (optional) + * @param sortOrder {@link SortOrder} (optional) + * @return status code 200 + */ + @Get("/api/v2/help_center/categories") + Mono<@Valid CategoriesResponse> listCategoriesNoLocale( + @QueryValue("sort_by") @Nullable SortCategoryBy sortBy, + @QueryValue("sort_order") @Nullable SortOrder sortOrder + ); + + /** + *

{@summary Show Category by Locale}

+ * Note: Admins and agents can query the{@link CategoryClient#showCategoryNoLocale(Long)}. + * End users and anonymous users can only use this command.

+ *

Translations are embedded within the category because they're not shared between resources.

+ *

Allowed for Anonymous users

+ * @param locale The locale the item is displayed in. (must be lowercase, even if returned from zendesk as mixed case) (required) + * @param categoryId The unique ID of the category (required) + * @return status code 200 + */ + @Get("/api/v2/help_center/{locale}/categories/{category_id}") + Mono<@Valid CategoryResponse> showCategory( + @PathVariable("locale") @NotNull LocaleAbbreviation locale, + @PathVariable("category_id") @NotNull Long categoryId + ); + + /** + *

{@summary Show Category}

+ * Allowed for Agents + * + * @param categoryId The unique ID of the category (required) + * @return status code 200 + */ + @Get("/api/v2/help_center/categories/{category_id}") + Mono<@Valid CategoryResponse> showCategoryNoLocale(@PathVariable("category_id") @NotNull Long categoryId); + + /** + *

{@summary Update Category by Locale}

+ *

This only updates category-level metadata such as the sorting position. This doesn't update category translations.

+ *

Allowed for Help Center managers

+ * + * @param localeAbbreviation The locale the item is displayed in. (must be lowercase, even if returned from zendesk as mixed case) (required) + * @param categoryId The unique ID of the category (required) + * @param createCategoryRequest {@link CreateCategoryRequest} (required) + * @return OK Response (status code 200) + */ + @Put("/api/v2/help_center/{locale}/categories/{category_id}") + Mono<@Valid CategoryResponse> updateCategory( + @PathVariable("locale") @NotNull LocaleAbbreviation localeAbbreviation, + @PathVariable("category_id") @NotNull Long categoryId, + @Body @NotNull @Valid CreateCategoryRequest createCategoryRequest + ); + + /** + *

{@summary Update Category}

+ *

This only updates category-level metadata such as the sorting position. This doesn't update category translations.

+ *

Allowed for Help Center managers

+ * + * @param categoryId The unique ID of the category (required) + * @param createCategoryRequest (optional) + * @return OK Response (status code 200) + */ + @Put("/api/v2/help_center/categories/{category_id}") + Mono<@Valid CategoryResponse> updateCategoryNoLocale( + @PathVariable("category_id") @NotNull Long categoryId, + @Body @Nullable @Valid CreateCategoryRequest createCategoryRequest + ); + + /** + *

{@summary Update Category Source Locale by Locale}

+ *

The endpoint updates the category source_locale property

+ *

Allowed for Agents

+ * + * @param categoryId The unique ID of the category (required) + * @return

OK Response

(status code 200) + */ + @Put("/api/v2/help_center/categories/{category_id}/source_locale") + Mono<@Valid CategoryResponse> updateCategorySourceLocale(@PathVariable("category_id") @NotNull Long categoryId); +} diff --git a/src/main/java/lol/pbu/z4j/client/LocaleClient.java b/src/main/java/lol/pbu/z4j/client/LocaleClient.java new file mode 100644 index 0000000..ff5942e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/LocaleClient.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.http.annotation.Get; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import lol.pbu.z4j.model.LocalesResponse; +import reactor.core.publisher.Mono; + +/** + *

Work with Locales in Zendesk.

+ * + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Retryable +@Client("zendesk") +public interface LocaleClient { + + /** + *

{@summary List Locales}

+ * Lists the translation locales available for the account.

Allowed for anyone + * + * @return Success response (status code 200) + */ + @Get("/api/v2/locales") + Mono<@Valid LocalesResponse> listLocales(); +} diff --git a/src/main/java/lol/pbu/z4j/client/SearchClient.java b/src/main/java/lol/pbu/z4j/client/SearchClient.java new file mode 100644 index 0000000..26cdfd0 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/SearchClient.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.QueryValue; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lol.pbu.z4j.model.SearchExportType; +import lol.pbu.z4j.model.SearchResponse; +import lol.pbu.z4j.model.SortBy; +import lol.pbu.z4j.model.SortOrder; +import reactor.core.publisher.Mono; + +/** + *

{@summary Perform Searches in Zendesk.}

+ * + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Retryable +@Client("zendesk") +public interface SearchClient { + + /** + *

{@summary Show Search Results Count}

+ * Returns the number of items matching the query rather than returning the items. The search string works the same as a regular search.

Allowed For Agents

+ * + * @param query Returns the search results. See Query syntax for details on the {@code query} parameter. For details on the query syntax, see the Zendesk Support search reference. (required) + * @return Success response (status code 200) + * or Error response (status code 400) + */ + @Get("/api/v2/search/count") + Mono<@Valid SearchResponse> count(@QueryValue("query") @NotNull String query); + + /** + *

{@summary Export Search Results}

+ *

Exports a set of results. See Query syntax for the syntax of the {@code query} parameter.

Use this endpoint for search queries that will return more than 1000 results. The result set is ordered only by the {@code created_at} attribute.

The search only returns results of a single object type. The following object types are supported: ticket, organization, user, or group.

You must specify the type in the {@code filter[type]} parameter. Searches with type in the query string will result in an error.

Allowed for Agents

Pagination

See Pagination.

Returns a maximum of 1000 records per page. The number of results shown in a page is determined by the {@code page[size]} parameter.

Note: You may experience a speed reduction or a timeout if you request 1000 results per page and you have many archived tickets in the results. Try reducing the number of results per page. We recommend 100 results per page.

The cursor specified by the {@code after_cursor} property in a response expires after one hour.

For more information on cursor-based pagination, see the following articles:

Export Search Results Limits

This API endpoint is rate-limited to 100 requests per minute per account. The limit also counts towards the global API rate limit.

+ * + * @param query Returns the search results. See Query syntax for details on the {@code query} parameter. For details on the query syntax, see the Zendesk Support search reference. (required) + * @param pageSize The number of results shown in a page. (required) + * @param pageAfter The cursor token for fetching the next page of results. (required) + * @param filterType The object type returned by the export query. Can be `ticket`, `organization`, `user`, or `group`. (required) + * @param include Sideloads to include in the response. Accepts a comma-separated list of values. The available sideloads depend on the search result types. (optional) + * @return Success response (status code 200) + * or Error response (status code 400) + */ + @Get("/api/v2/search/export") + Mono<@Valid SearchResponse> export( + @QueryValue("query") @NotNull String query, + @QueryValue("page[size]") @NotNull Integer pageSize, + @QueryValue("page[after]") @NotNull String pageAfter, + @QueryValue("filter[type]") @NotNull SearchExportType filterType, + @QueryValue("include") @Nullable String include + ); + + /** + *

{@summary List Search Results}

+ *

Returns the search results. See Query syntax for details on the {@code query} parameter.

Use the ampersand character (&) to append the {@code sort_by} or {@code sort_order} parameters to the URL.

For examples, see Searching with Zendesk API.

This endpoint has its own rate limit. The rate limit counts towards the global API rate limit. See Limits.

Allowed For Agents

Pagination

Offset pagination may result in duplicate results when paging. You can also use the Export Search Results endpoint, which uses cursor-based pagination and doesn't return duplicate results. See Using cursor pagination for more information.

+ * + * @param query Returns the search results. See Query syntax for details on the {@code query} parameter. For details on the query syntax, see the Zendesk Support search reference. (required) + * @param sortBy One of {@code updated_at}, {@code created_at}, {@code priority}, {@code status}, or {@code ticket_type}. Defaults to sorting by relevance (optional) + * @param sortOrder Defaults to descending (optional) + * @param include Sideloads to include in the response. Accepts a comma-separated list of values. The available sideloads depend on the search result types. (optional) + * @return Success response (status code 200) + * or Error response (status code 400) + */ + @Get("/api/v2/search") + Mono<@Valid SearchResponse> list( + @QueryValue("query") @NotNull String query, + @QueryValue("sort_by") @Nullable SortBy sortBy, + @QueryValue("sort_order") @Nullable SortOrder sortOrder, + @QueryValue("include") @Nullable String include + ); +} diff --git a/src/main/java/lol/pbu/z4j/client/TicketClient.java b/src/main/java/lol/pbu/z4j/client/TicketClient.java new file mode 100644 index 0000000..63e2955 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/TicketClient.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.*; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lol.pbu.z4j.model.*; +import reactor.core.publisher.Mono; + +/** + *

Work with Tickets in Zendesk.

+ * + * @since 0.1.1 + * @author Jonathan-Zollinger + */ +@Retryable +@Client("zendesk") +public interface TicketClient { + + /** + *

{@summary Create Ticket}

+ * + * @param ticketCreateRequest (required) + * @return Create ticket (status code 201) + */ + @Post("/api/v2/tickets") + Mono<@Valid TicketResponse> createTicket(@Body @NotNull @Valid TicketCreateRequest ticketCreateRequest); + + /** + *

{@summary Create Custom Ticket Field}

+ * See{@link TicketFieldTypeEnum} and Adding custom ticket fields to your tickets and forms +

See About custom field types in the Zendesk Help + * Center.

Allowed For

+ *

Field limits

We recommend the following best practices for ticket fields limits. + * Creating more than these amounts can affect performance.

+ * + * + * @return Created response (status code 201) + */ + @Post("/api/v2/ticket_fields") + Mono<@Valid TicketFieldResponse> createTicketField(@Body @NotNull @Valid TicketFieldCreateRequest ticketFieldCreateRequest); + + /** + *

{@summary Count Tickets}

+ * Returns an approximate count of tickets in the account. If the count exceeds 100,000, it is updated every 24 hours.

{@code ccd} lists tickets that the specified user is cc'd on.

The {@code count[refreshed_at]} property is a timestamp that indicates when the count was last updated.

Note: When the count exceeds 100,000, {@code count[refreshed_at]} may occasionally be null. This indicates that the count is being updated in the background, and {count[value]} is limited to 100,000 until the update is complete.

Allowed For

+ * + * @return Count of tickets (status code 200) + */ + @Get("/api/v2/tickets/count") + Mono<@Valid TicketCountResponse> getTicketCount(); + + /** + *

{@summary List Ticket Fields}

+ *

Returns a list of all system and custom ticket fields in your account.

For end users, only the ticket fields with visible_in_portal set to true are returned.

Consider caching this resource to use with the{@link TicketClient}.

Allowed For

+ * + * @param locale Forces the {@code titleInPortal} property to return a dynamic content variant for the specified locale. Only accepts {@link LocaleClient#listLocales() active locale ids}. (optional) + * @param creator Includes the {@code creatorUserId} and {@code creatorAppName} properties in the response. If the ticket field is created by an app, {@code creatorAppName} is the name of the app and {@code creatorUserId} is {@code -1}. If the ticket field is not created by an app, {@code creatorAppName} is null. (optional) + * @return Success response (status code 200) + */ + @Get("/api/v2/ticket_fields") + Mono<@Valid TicketFieldsResponse> listTicketFields(@QueryValue("locale") @Nullable LocaleAbbreviation localeAbbreviation, @QueryValue("creator") @Nullable Boolean creator); + + /** + *

{@summary List Tickets}

+ * + * @param externalId Lists tickets by external id. External ids don't have to be unique for each ticket. As a result, the request may return multiple tickets with the same external id. (optional) + * @return List tickets (status code 200) + */ + @Get("/api/v2/tickets") + Mono<@Valid TicketsResponse> listTickets(@QueryValue("external_id") @Nullable String externalId); + + /** + *

{@summary Show Ticket}

+ *

Returns a number of ticket properties though not the ticket comments. To get the comments, use List Comments

Allowed For

+ * + * @param ticketId The ID of the ticket (required) + * @return Ticket (status code 200) + */ + @Get("/api/v2/tickets/{ticket_id}") + Mono<@Valid TicketResponse> showTicket(@PathVariable("ticket_id") @NotNull Long ticketId); + + /** + *

{@summary Update Ticket}

+ * + * @param ticketId The ID of the ticket (required) + * @param ticketUpdateRequest (optional) + * @return Successful request (status code 200) + */ + @Put("/api/v2/tickets/{ticket_id}") + Mono<@Valid TicketUpdateResponse> updateTicket(@PathVariable("ticket_id") @NotNull Long ticketId, @Body @Nullable @Valid TicketUpdateRequest ticketUpdateRequest); +} diff --git a/src/main/java/lol/pbu/z4j/client/UserSegmentClient.java b/src/main/java/lol/pbu/z4j/client/UserSegmentClient.java new file mode 100644 index 0000000..80f709c --- /dev/null +++ b/src/main/java/lol/pbu/z4j/client/UserSegmentClient.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.client; + +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.*; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.retry.annotation.Retryable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lol.pbu.z4j.model.*; +import reactor.core.publisher.Mono; + +/** + *

Work with User Segments in Zendesk.

+ * + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Retryable +@Client("zendesk") +public interface UserSegmentClient { + + /** + *

{@summary Create User Segment}

+ *

Allowed for Help Center managers

+ * + * @param createUserSegmentRequest (optional) + * @return Created response (status code 201) + * or Bad request response (status code 400) + */ + @Post("/api/v2/help_center/user_segments") + Mono<@Valid UserSegmentResponse> createUserSegment( + @Body @Nullable @Valid CreateUserSegmentRequest createUserSegmentRequest + ); + + /** + *

{@summary Delete User Segment}

+ *

Allowed for Help Center managers

+ * + * @param userSegmentId The unique ID of the user segment (required) + * @return Response when the use segment was deleted (status code 204) + */ + @Delete("/api/v2/help_center/user_segments/{user_segment_id}") + Mono deleteUserSegment( + @PathVariable("user_segment_id") @NotNull Long userSegmentId + ); + + /** + *

{@summary List Sections with User Segment}

+ * Lists the sections that use the specified user segment.

+ *

Allowed for Help Center managers

+ * + * @param userSegmentId The unique ID of the user segment (required) + * @return OK Response (status code 200) + */ + @Get("/api/v2/help_center/user_segments/{user_segment_id}/sections") + Mono<@Valid SectionsResponse> listUserSegmentSections( + @PathVariable("user_segment_id") @NotNull Long userSegmentId + ); + + /** + *

{@summary List Topics with User Segment}

+ *

Lists the topics that use the specified user segment.

+ * + * Pagination is not currently supported. Open an issue with us to let us know you'd like this supported! + *
+ *

Allowed for Help Center managers

+ * + * @param userSegmentId The unique ID of the user segment (required) + * @return OK Response (status code 200) + */ + @Get("/api/v2/help_center/user_segments/{user_segment_id}/topics") + Mono<@Valid TopicsResponse> listUserSegmentTopics( + @PathVariable("user_segment_id") @NotNull Long userSegmentId + ); + + /** + *

{@summary List User Segments}

+ *

Some user segments can only be applied to sections and topics on certain Guide plans. + * For instance, user segments with a user_type of "staff" cannot be applied to sections and topics on accounts on the Guide Lite plan or the Suite Team plan.
+ * + *

Allowed for Help Center managers

+ * + * @param builtIn Only built_in user segments if true, only custom user segments if false (optional) + * @return OK response (status code 200) + */ + @Get("/api/v2/help_center/user_segments") + Mono<@Valid UserSegmentsResponse> listUserSegments( + @QueryValue("built_in") @Nullable Boolean builtIn + ); + + /** + *

{@summary Show User Segment}

+ *

Allowed for Help Center managers

+ * + * @param userSegmentId The unique ID of the user segment (required) + * @return OK Response (status code 200) + */ + @Get("/api/v2/help_center/user_segments/{user_segment_id}") + Mono<@Valid UserSegmentResponse> showUserSegment( + @PathVariable("user_segment_id") @NotNull Long userSegmentId + ); + + /** + *

{@summary Update User Segment}

+ *

Allowed for Help Center managers

+ * + * @param userSegmentId The unique ID of the user segment (required) + * @param createUserSegmentRequest (optional) + * @return OK Response (status code 200) + * or Bad request Response (status code 400) + */ + @Put("/api/v2/help_center/user_segments/{user_segment_id}") + Mono<@Valid UserSegmentResponse> updateUserSegment( + @PathVariable("user_segment_id") @NotNull Long userSegmentId, + @Body @NotNull @Valid CreateUserSegmentRequest createUserSegmentRequest + ); +} diff --git a/src/main/java/lol/pbu/z4j/model/Article.java b/src/main/java/lol/pbu/z4j/model/Article.java new file mode 100644 index 0000000..72fb745 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Article.java @@ -0,0 +1,337 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * Article + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Article.JSON_PROPERTY_LOCALE, + Article.JSON_PROPERTY_PERMISSION_GROUP_ID, + Article.JSON_PROPERTY_TITLE, + Article.JSON_PROPERTY_AUTHOR_ID, + Article.JSON_PROPERTY_BODY, + Article.JSON_PROPERTY_COMMENTS_DISABLED, + Article.JSON_PROPERTY_CONTENT_TAG_IDS, + Article.JSON_PROPERTY_CREATED_AT, + Article.JSON_PROPERTY_DRAFT, + Article.JSON_PROPERTY_EDITED_AT, + Article.JSON_PROPERTY_HTML_URL, + Article.JSON_PROPERTY_ID, + Article.JSON_PROPERTY_LABEL_NAMES, + Article.JSON_PROPERTY_OUTDATED, + Article.JSON_PROPERTY_OUTDATED_LOCALES, + Article.JSON_PROPERTY_POSITION, + Article.JSON_PROPERTY_PROMOTED, + Article.JSON_PROPERTY_SECTION_ID, + Article.JSON_PROPERTY_SOURCE_LOCALE, + Article.JSON_PROPERTY_UPDATED_AT, + Article.JSON_PROPERTY_URL, + Article.JSON_PROPERTY_USER_SEGMENT_ID, + Article.JSON_PROPERTY_USER_SEGMENT_IDS, + Article.JSON_PROPERTY_VOTE_COUNT, + Article.JSON_PROPERTY_VOTE_SUM, +}) +@Serdeable +public class Article implements SearchResultsInner { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_PERMISSION_GROUP_ID = "permission_group_id"; + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_COMMENTS_DISABLED = "comments_disabled"; + public static final String JSON_PROPERTY_CONTENT_TAG_IDS = "content_tag_ids"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DRAFT = "draft"; + public static final String JSON_PROPERTY_EDITED_AT = "edited_at"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_LABEL_NAMES = "label_names"; + public static final String JSON_PROPERTY_OUTDATED = "outdated"; + public static final String JSON_PROPERTY_OUTDATED_LOCALES = "outdated_locales"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_PROMOTED = "promoted"; + public static final String JSON_PROPERTY_SECTION_ID = "section_id"; + public static final String JSON_PROPERTY_SOURCE_LOCALE = "source_locale"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_USER_SEGMENT_ID = "user_segment_id"; + public static final String JSON_PROPERTY_USER_SEGMENT_IDS = "user_segment_ids"; + public static final String JSON_PROPERTY_VOTE_COUNT = "vote_count"; + public static final String JSON_PROPERTY_VOTE_SUM = "vote_sum"; + + /** + * The locale that the article is being displayed in + */ + @NotNull + @JsonProperty(JSON_PROPERTY_LOCALE) + private LocaleAbbreviation localeAbbreviation; + + /** + * The id of the permission group which defines who can edit and publish this article + */ + @NotNull + @JsonProperty(JSON_PROPERTY_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + /** + * The title of the article + */ + @NotNull + @JsonProperty(JSON_PROPERTY_TITLE) + private String title; + + /** + * The id of the user who wrote the article (set to the user who made the request on create by default) + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long authorId; + + /** + *

HTML body of the article. Unsafe tags and attributes may be removed before display. For a list of safe tags and attributes, see Allowing unsafe HTML in Help Center articles in Zendesk help

+ */ + @Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String body; + + /** + * True if comments are disabled; false otherwise + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COMMENTS_DISABLED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean commentsDisabled; + + /** + * The list of content tags attached to the article + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TAG_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> contentTagIds; + + /** + * The time the article was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * True if the translation for the current locale is a draft; false otherwise. false by default. Can be set when creating but not when updating. For updating, see Translations + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DRAFT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean draft; + + /** + * The time the article was last edited in its displayed locale + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EDITED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String editedAt; + + /** + * The url of the article in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when the article is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * An array of label names associated with this article. By default, no label names are used. Only available on certain plans + */ + @Nullable + @JsonProperty(JSON_PROPERTY_LABEL_NAMES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> labelNames; + + /** + * Deprecated. Always false because the source translation is always the most up-to-date translation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OUTDATED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean outdated; + + /** + * Locales in which the article was marked as outdated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OUTDATED_LOCALES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> outdatedLocales; + + /** + * The position of this article in the article list. 0 by default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long position; + + /** + * True if this article is promoted; false otherwise. false by default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PROMOTED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean promoted; + + /** + * The id of the section to which this article belongs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SECTION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long sectionId; + + /** + * The source (default) locale of the article + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceLocale; + + /** + * The time the article was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of the article + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The id of the user segment which defines who can see this article. Set to null to make it accessible to everyone. Either user_segment_id or user_segment_ids must be specified + */ + @Nullable + @JsonProperty(JSON_PROPERTY_USER_SEGMENT_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long userSegmentId; + + /** + * List of user segment ids which define who can view this article. Set to an empty list to make it accessible to everyone. For Enterprise plans only this may contain more than one user_segment_id. Either user_segment_id or user_segment_ids must be specified + */ + @Nullable + @JsonProperty(JSON_PROPERTY_USER_SEGMENT_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> userSegmentIds; + + /** + * The total number of upvotes and downvotes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteCount; + + /** + * The sum of upvotes (+1) and downvotes (-1), which may be positive or negative + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_SUM) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteSum; + + + /** + * Add an item to the contentTagIds property in a chainable fashion. + * + * @return The same instance of Article for chaining. + */ + public Article addContentTagIdsItem(String contentTagIdsItem) { + if (contentTagIds == null) { + contentTagIds = new ArrayList<>(); + } + contentTagIds.add(contentTagIdsItem); + return this; + } + + /** + * Add an item to the labelNames property in a chainable fashion. + * + * @return The same instance of Article for chaining. + */ + public Article addLabelNamesItem(String labelNamesItem) { + if (labelNames == null) { + labelNames = new ArrayList<>(); + } + labelNames.add(labelNamesItem); + return this; + } + + /** + * Add an item to the userSegmentIds property in a chainable fashion. + * + * @return The same instance of Article for chaining. + */ + public Article addUserSegmentIdsItem(String userSegmentIdsItem) { + if (userSegmentIds == null) { + userSegmentIds = new ArrayList<>(); + } + userSegmentIds.add(userSegmentIdsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleAttachment.java b/src/main/java/lol/pbu/z4j/model/ArticleAttachment.java new file mode 100644 index 0000000..4ec4b10 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleAttachment.java @@ -0,0 +1,174 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ArticleAttachment + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ArticleAttachment.JSON_PROPERTY_ARTICLE_ID, + ArticleAttachment.JSON_PROPERTY_CONTENT_TYPE, + ArticleAttachment.JSON_PROPERTY_CONTENT_URL, + ArticleAttachment.JSON_PROPERTY_CREATED_AT, + ArticleAttachment.JSON_PROPERTY_FILE, + ArticleAttachment.JSON_PROPERTY_FILE_NAME, + ArticleAttachment.JSON_PROPERTY_GUIDE_MEDIA_ID, + ArticleAttachment.JSON_PROPERTY_ID, + ArticleAttachment.JSON_PROPERTY_INLINE, + ArticleAttachment.JSON_PROPERTY_LOCALE, + ArticleAttachment.JSON_PROPERTY_SIZE, + ArticleAttachment.JSON_PROPERTY_UPDATED_AT, + ArticleAttachment.JSON_PROPERTY_URL, +}) +@Serdeable +public class ArticleAttachment { + + public static final String JSON_PROPERTY_ARTICLE_ID = "article_id"; + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_FILE = "file"; + public static final String JSON_PROPERTY_FILE_NAME = "file_name"; + public static final String JSON_PROPERTY_GUIDE_MEDIA_ID = "guide_media_id"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_INLINE = "inline"; + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_SIZE = "size"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The associated article, if present + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ARTICLE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long articleId; + + /** + * The file type. Example: image/png + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentType; + + /** + * URL where the attachment file can be downloaded + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentUrl; + + /** + * The time the article attachment was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * File to upload, applicable only during creation. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object file; + + /** + * The file name + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String fileName; + + /** + * Unique identifier for the guide-media to associate with this attachment, applicable only during creation. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GUIDE_MEDIA_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String guideMediaId; + + /** + * Assigned ID when the article attachment is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The attached file is shown in the admin interface for inline attachments. Its URL can be referenced in the article's HTML body. Inline attachments are image files directly embedded in the article body. If false, the attachment is listed in the list of attachments. The default value is false + */ + @Nullable + @JsonProperty(JSON_PROPERTY_INLINE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean inline; + + /** + * The locale of translation that the attachment will be attached to and can only be set on inline attachments + */ + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private LocaleAbbreviation localeAbbreviation; + + /** + * The attachment file size in bytes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long size; + + /** + * The time the article attachment was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The URL of the article attachment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleAttachmentResponse.java b/src/main/java/lol/pbu/z4j/model/ArticleAttachmentResponse.java new file mode 100644 index 0000000..393cc1e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleAttachmentResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ArticleAttachmentResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(ArticleAttachmentResponse.JSON_PROPERTY_ARTICLE_ATTACHMENT) +@Serdeable +public class ArticleAttachmentResponse { + + public static final String JSON_PROPERTY_ARTICLE_ATTACHMENT = "article_attachment"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_ARTICLE_ATTACHMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ArticleAttachment articleAttachment; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleAttachmentsResponse.java b/src/main/java/lol/pbu/z4j/model/ArticleAttachmentsResponse.java new file mode 100644 index 0000000..446816e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleAttachmentsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArticleAttachmentsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(ArticleAttachmentsResponse.JSON_PROPERTY_ARTICLE_ATTACHMENTS) +@Serdeable +public class ArticleAttachmentsResponse { + + public static final String JSON_PROPERTY_ARTICLE_ATTACHMENTS = "article_attachments"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ARTICLE_ATTACHMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid ArticleAttachment> articleAttachments; + + /** + * Add an item to the articleAttachments property in a chainable fashion. + * + * @return The same instance of ArticleAttachmentsResponse for chaining. + */ + public ArticleAttachmentsResponse addArticleAttachmentsItem(ArticleAttachment articleAttachmentsItem) { + if (articleAttachments == null) { + articleAttachments = new ArrayList<>(); + } + articleAttachments.add(articleAttachmentsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleRequest.java b/src/main/java/lol/pbu/z4j/model/ArticleRequest.java new file mode 100644 index 0000000..2993866 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleRequest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * ArticleRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + ArticleRequest.JSON_PROPERTY_ARTICLE, + ArticleRequest.JSON_PROPERTY_NOTIFY_SUBSCRIBERS, +}) +@Serdeable +public class ArticleRequest { + + public static final String JSON_PROPERTY_ARTICLE = "article"; + public static final String JSON_PROPERTY_NOTIFY_SUBSCRIBERS = "notify_subscribers"; + + @NotNull + @Valid + @JsonProperty(JSON_PROPERTY_ARTICLE) + private ArticleRequestArticle article; + + @Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_SUBSCRIBERS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean notifySubscribers; + + public ArticleRequest(ArticleRequestArticle article) { + this.article = article; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleRequestArticle.java b/src/main/java/lol/pbu/z4j/model/ArticleRequestArticle.java new file mode 100644 index 0000000..6561894 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleRequestArticle.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import lombok.experimental.Accessors; + +/** + * ArticleRequestArticle + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@AllArgsConstructor +@JsonPropertyOrder({ + ArticleRequestArticle.JSON_PROPERTY_LOCALE, + ArticleRequestArticle.JSON_PROPERTY_PERMISSION_GROUP_ID, + ArticleRequestArticle.JSON_PROPERTY_TITLE, + ArticleRequestArticle.JSON_PROPERTY_USER_SEGMENT_ID, + ArticleRequestArticle.JSON_PROPERTY_BODY, +}) +@Serdeable +public class ArticleRequestArticle { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_PERMISSION_GROUP_ID = "permission_group_id"; + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_USER_SEGMENT_ID = "user_segment_id"; + public static final String JSON_PROPERTY_BODY = "body"; + + @NotNull + @JsonProperty(JSON_PROPERTY_LOCALE) + private LocaleAbbreviation localeAbbreviation; + + @NotNull + @JsonProperty(JSON_PROPERTY_PERMISSION_GROUP_ID) + private Long permissionGroupId = 0L; + + @NotNull + @JsonProperty(JSON_PROPERTY_TITLE) + private String title; + + @NotNull + @JsonProperty(JSON_PROPERTY_USER_SEGMENT_ID) + private Long userSegmentId; + + @Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String body; + + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleResponse.java b/src/main/java/lol/pbu/z4j/model/ArticleResponse.java new file mode 100644 index 0000000..3ec0a59 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ArticleResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(ArticleResponse.JSON_PROPERTY_ARTICLE) +@Serdeable +public class ArticleResponse { + + public static final String JSON_PROPERTY_ARTICLE = "article"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_ARTICLE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Article article; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticleSearchResponse.java b/src/main/java/lol/pbu/z4j/model/ArticleSearchResponse.java new file mode 100644 index 0000000..9d19941 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticleSearchResponse.java @@ -0,0 +1,87 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArticleSearchResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ArticleSearchResponse.JSON_PROPERTY_RESULT_TYPE, + ArticleSearchResponse.JSON_PROPERTY_RESULTS, + ArticleSearchResponse.JSON_PROPERTY_SNIPPET, +}) +@Serdeable +public class ArticleSearchResponse { + + public static final String JSON_PROPERTY_RESULT_TYPE = "result_type"; + public static final String JSON_PROPERTY_RESULTS = "results"; + public static final String JSON_PROPERTY_SNIPPET = "snippet"; + + /** + * For articles, always the string article + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RESULT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String resultType = "article"; + + @Nullable + @JsonProperty(JSON_PROPERTY_RESULTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Article> results; + + /** + *

The portion of an article that is relevant to the search query, with matching words or phrases delimited by <em></em> tags. Example: a query for carrot potato might return the snippet ...don't confuse <em>carrots</em> with <em>potatoes</em>...

+ */ + @Nullable + @JsonProperty(JSON_PROPERTY_SNIPPET) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String snippet; + + /** + * Add an item to the results property in a chainable fashion. + * + * @return The same instance of ArticleSearchResponse for chaining. + */ + public ArticleSearchResponse addResultsItem(Article resultsItem) { + if (results == null) { + results = new ArrayList<>(); + } + results.add(resultsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/ArticlesResponse.java b/src/main/java/lol/pbu/z4j/model/ArticlesResponse.java new file mode 100644 index 0000000..3ba5353 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ArticlesResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArticlesResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(ArticlesResponse.JSON_PROPERTY_ARTICLES) +@Serdeable +public class ArticlesResponse { + + public static final String JSON_PROPERTY_ARTICLES = "articles"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ARTICLES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Article> articles; + + /** + * Add an item to the articles property in a chainable fashion. + * + * @return The same instance of ArticlesResponse for chaining. + */ + public ArticlesResponse addArticlesItem(Article articlesItem) { + if (articles == null) { + articles = new ArrayList<>(); + } + articles.add(articlesItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Attachment.java b/src/main/java/lol/pbu/z4j/model/Attachment.java new file mode 100644 index 0000000..d3b3a3a --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Attachment.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * A file represented as an Attachment object + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Attachment.JSON_PROPERTY_CONTENT_TYPE, + Attachment.JSON_PROPERTY_CONTENT_URL, + Attachment.JSON_PROPERTY_DELETED, + Attachment.JSON_PROPERTY_FILE_NAME, + Attachment.JSON_PROPERTY_HEIGHT, + Attachment.JSON_PROPERTY_ID, + Attachment.JSON_PROPERTY_INLINE, + Attachment.JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE, + Attachment.JSON_PROPERTY_MALWARE_SCAN_RESULT, + Attachment.JSON_PROPERTY_MAPPED_CONTENT_URL, + Attachment.JSON_PROPERTY_SIZE, + Attachment.JSON_PROPERTY_URL, + Attachment.JSON_PROPERTY_WIDTH, + Attachment.JSON_PROPERTY_THUMBNAILS, +}) +@Serdeable +public class Attachment { + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; + public static final String JSON_PROPERTY_DELETED = "deleted"; + public static final String JSON_PROPERTY_FILE_NAME = "file_name"; + public static final String JSON_PROPERTY_HEIGHT = "height"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_INLINE = "inline"; + public static final String JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE = "malware_access_override"; + public static final String JSON_PROPERTY_MALWARE_SCAN_RESULT = "malware_scan_result"; + public static final String JSON_PROPERTY_MAPPED_CONTENT_URL = "mapped_content_url"; + public static final String JSON_PROPERTY_SIZE = "size"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_WIDTH = "width"; + public static final String JSON_PROPERTY_THUMBNAILS = "thumbnails"; + + /** + * The content type of the image. Example value: \"image/png\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentType; + + /** + * A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See Working with url properties + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentUrl; + + /** + * If true, the attachment has been deleted + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DELETED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean deleted; + + /** + * The name of the image file + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String fileName; + + /** + * The height of the image file in pixels. If height is unknown, returns null + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String height; + + /** + * Automatically assigned when created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer id; + + /** + * If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false + */ + @Nullable + @JsonProperty(JSON_PROPERTY_INLINE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean inline; + + /** + * If true, you can download an attachment flagged as malware. If false, you can't download such an attachment. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean malwareAccessOverride; + + @Nullable + @JsonProperty(JSON_PROPERTY_MALWARE_SCAN_RESULT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private AttachmentBaseMalwareScanResult malwareScanResult; + + /** + * The URL the attachment image file has been mapped to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MAPPED_CONTENT_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String mappedContentUrl; + + /** + * The size of the image file in bytes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer size; + + /** + * A URL to access the attachment details + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The width of the image file in pixels. If width is unknown, returns null + */ + @Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String width; + + /** + * An array of attachment objects. Note that photo thumbnails do not have thumbnails + */ + @Nullable + @JsonProperty(JSON_PROPERTY_THUMBNAILS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid AttachmentBase> thumbnails; + +} diff --git a/src/main/java/lol/pbu/z4j/model/AttachmentBase.java b/src/main/java/lol/pbu/z4j/model/AttachmentBase.java new file mode 100644 index 0000000..7136052 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/AttachmentBase.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * AttachmentBase + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + AttachmentBase.JSON_PROPERTY_CONTENT_TYPE, + AttachmentBase.JSON_PROPERTY_CONTENT_URL, + AttachmentBase.JSON_PROPERTY_DELETED, + AttachmentBase.JSON_PROPERTY_FILE_NAME, + AttachmentBase.JSON_PROPERTY_HEIGHT, + AttachmentBase.JSON_PROPERTY_ID, + AttachmentBase.JSON_PROPERTY_INLINE, + AttachmentBase.JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE, + AttachmentBase.JSON_PROPERTY_MALWARE_SCAN_RESULT, + AttachmentBase.JSON_PROPERTY_MAPPED_CONTENT_URL, + AttachmentBase.JSON_PROPERTY_SIZE, + AttachmentBase.JSON_PROPERTY_URL, + AttachmentBase.JSON_PROPERTY_WIDTH, +}) +@Serdeable +public class AttachmentBase { + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; + public static final String JSON_PROPERTY_DELETED = "deleted"; + public static final String JSON_PROPERTY_FILE_NAME = "file_name"; + public static final String JSON_PROPERTY_HEIGHT = "height"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_INLINE = "inline"; + public static final String JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE = "malware_access_override"; + public static final String JSON_PROPERTY_MALWARE_SCAN_RESULT = "malware_scan_result"; + public static final String JSON_PROPERTY_MAPPED_CONTENT_URL = "mapped_content_url"; + public static final String JSON_PROPERTY_SIZE = "size"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_WIDTH = "width"; + + /** + * The content type of the image. Example value: \"image/png\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentType; + + /** + * A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See Working with url properties + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentUrl; + + /** + * If true, the attachment has been deleted + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DELETED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean deleted; + + /** + * The name of the image file + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String fileName; + + /** + * The height of the image file in pixels. If height is unknown, returns null + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String height; + + /** + * Automatically assigned when created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer id; + + /** + * If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false + */ + @Nullable + @JsonProperty(JSON_PROPERTY_INLINE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean inline; + + /** + * If true, you can download an attachment flagged as malware. If false, you can't download such an attachment. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MALWARE_ACCESS_OVERRIDE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean malwareAccessOverride; + + @Nullable + @JsonProperty(JSON_PROPERTY_MALWARE_SCAN_RESULT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private AttachmentBaseMalwareScanResult malwareScanResult; + + /** + * The URL the attachment image file has been mapped to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MAPPED_CONTENT_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String mappedContentUrl; + + /** + * The size of the image file in bytes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer size; + + /** + * A URL to access the attachment details + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The width of the image file in pixels. If width is unknown, returns null + */ + @Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String width; + +} diff --git a/src/main/java/lol/pbu/z4j/model/AttachmentBaseMalwareScanResult.java b/src/main/java/lol/pbu/z4j/model/AttachmentBaseMalwareScanResult.java new file mode 100644 index 0000000..98a3b6e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/AttachmentBaseMalwareScanResult.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: \"malware_found\", \"malware_not_found\", \"failed_to_scan\", \"not_scanned\" + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum AttachmentBaseMalwareScanResult { + + @JsonProperty("malware_found") + MALWARE_FOUND("malware_found"), + + @JsonProperty("malware_not_found") + MALWARE_NOT_FOUND("malware_not_found"), + + @JsonProperty("failed_to_scan") + FAILED_TO_SCAN("failed_to_scan"), + + @JsonProperty("not_scanned") + NOT_SCANNED("not_scanned"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static AttachmentBaseMalwareScanResult fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/AttachmentThumbnails.java b/src/main/java/lol/pbu/z4j/model/AttachmentThumbnails.java new file mode 100644 index 0000000..9b0d334 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/AttachmentThumbnails.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * AttachmentThumbnails + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(AttachmentThumbnails.JSON_PROPERTY_THUMBNAILS) +@Serdeable +public class AttachmentThumbnails { + + public static final String JSON_PROPERTY_THUMBNAILS = "thumbnails"; + + /** + * An array of attachment objects. Note that photo thumbnails do not have thumbnails + */ + @Nullable + @JsonProperty(JSON_PROPERTY_THUMBNAILS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid AttachmentBase> thumbnails; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Audit.java b/src/main/java/lol/pbu/z4j/model/Audit.java new file mode 100644 index 0000000..7927add --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Audit.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.List; + +/** + * Audit + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Audit.JSON_PROPERTY_AUTHOR_ID, + Audit.JSON_PROPERTY_CREATED_AT, + Audit.JSON_PROPERTY_EVENTS, + Audit.JSON_PROPERTY_ID, + Audit.JSON_PROPERTY_METADATA, + Audit.JSON_PROPERTY_TICKET_ID, + Audit.JSON_PROPERTY_VIA, +}) +@Serdeable +public class Audit { + + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_EVENTS = "events"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_METADATA = "metadata"; + public static final String JSON_PROPERTY_TICKET_ID = "ticket_id"; + public static final String JSON_PROPERTY_VIA = "via"; + + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long authorId; + + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + @Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid AuditEventsInner> events; + + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + @Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object metadata; + + @Nullable + @JsonProperty(JSON_PROPERTY_TICKET_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long ticketId; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VIA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Via via; + +} diff --git a/src/main/java/lol/pbu/z4j/model/AuditEventsInner.java b/src/main/java/lol/pbu/z4j/model/AuditEventsInner.java new file mode 100644 index 0000000..185ce86 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/AuditEventsInner.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * AuditEventsInner + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + AuditEventsInner.JSON_PROPERTY_BODY, + AuditEventsInner.JSON_PROPERTY_FIELD_NAME, + AuditEventsInner.JSON_PROPERTY_ID, + AuditEventsInner.JSON_PROPERTY_TYPE, + AuditEventsInner.JSON_PROPERTY_VALUE, +}) +@Serdeable +public class AuditEventsInner { + + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_FIELD_NAME = "field_name"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_VALUE = "value"; + + @Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String body; + + @Nullable + @JsonProperty(JSON_PROPERTY_FIELD_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String fieldName; + + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String type; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private AuditEventsInnerValue value; + +} diff --git a/src/main/java/lol/pbu/z4j/model/AuditEventsInnerValue.java b/src/main/java/lol/pbu/z4j/model/AuditEventsInnerValue.java new file mode 100644 index 0000000..ffcceca --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/AuditEventsInnerValue.java @@ -0,0 +1,23 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public interface AuditEventsInnerValue { + +} diff --git a/src/main/java/lol/pbu/z4j/model/BadRequestErrorResponse.java b/src/main/java/lol/pbu/z4j/model/BadRequestErrorResponse.java new file mode 100644 index 0000000..f798ec7 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/BadRequestErrorResponse.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.HashMap; +import java.util.Map; + +/** + * BadRequestErrorResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(BadRequestErrorResponse.JSON_PROPERTY_ERRORS) +@Serdeable +public class BadRequestErrorResponse { + + public static final String JSON_PROPERTY_ERRORS = "errors"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map errors; + + /** + * Set the value for the key for the errors map property in a chainable fashion. + * + * @return The same instance of BadRequestErrorResponse for chaining. + */ + public BadRequestErrorResponse putErrorsItem(String key, Object errorsItem) { + if (errors == null) { + errors = new HashMap<>(); + } + errors.put(key, errorsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/CategoriesResponse.java b/src/main/java/lol/pbu/z4j/model/CategoriesResponse.java new file mode 100644 index 0000000..2bfa3e8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CategoriesResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * CategoriesResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CategoriesResponse.JSON_PROPERTY_CATEGORIES) +@Serdeable +public class CategoriesResponse { + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + + @Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Category> categories; + + /** + * Add an item to the categories property in a chainable fashion. + * + * @return The same instance of CategoriesResponse for chaining. + */ + public CategoriesResponse addCategoriesItem(Category categoriesItem) { + if (categories == null) { + categories = new ArrayList<>(); + } + categories.add(categoriesItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Category.java b/src/main/java/lol/pbu/z4j/model/Category.java new file mode 100644 index 0000000..fcfdbcc --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Category.java @@ -0,0 +1,162 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * Category + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Category.JSON_PROPERTY_NAME, + Category.JSON_PROPERTY_CREATED_AT, + Category.JSON_PROPERTY_DESCRIPTION, + Category.JSON_PROPERTY_HTML_URL, + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_LOCALE, + Category.JSON_PROPERTY_OUTDATED, + Category.JSON_PROPERTY_POSITION, + Category.JSON_PROPERTY_SOURCE_LOCALE, + Category.JSON_PROPERTY_UPDATED_AT, + Category.JSON_PROPERTY_URL, +}) +@Serdeable +public class Category { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_OUTDATED = "outdated"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_SOURCE_LOCALE = "source_locale"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The name of the category + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * The time at which the category was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * The description of the category + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The url of this category in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when creating categories + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The locale where the category is displayed + */ + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private LocaleAbbreviation localeAbbreviation; + + /** + * Whether the category is out of date + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OUTDATED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean outdated; + + /** + * The position of this category relative to other categories + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long position; + + /** + * The source (default) locale of the category + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceLocale; + + /** + * The time at which the category was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + /** + * The API url of this category + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + public Category(String name) { + this.name = name; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/CategoryResponse.java b/src/main/java/lol/pbu/z4j/model/CategoryResponse.java new file mode 100644 index 0000000..29bd330 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CategoryResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CategoryResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CategoryResponse.JSON_PROPERTY_CATEGORY) +@Serdeable +public class CategoryResponse { + + public static final String JSON_PROPERTY_CATEGORY = "category"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Category category; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Collaborator.java b/src/main/java/lol/pbu/z4j/model/Collaborator.java new file mode 100644 index 0000000..4348f2c --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Collaborator.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.Email; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * Collaborator + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Collaborator.JSON_PROPERTY_EMAIL, + Collaborator.JSON_PROPERTY_NAME, +}) +@Serdeable +public class Collaborator { + + public static final String JSON_PROPERTY_EMAIL = "email"; + public static final String JSON_PROPERTY_NAME = "name"; + + @Nullable + @Email + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String email; + + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Comment.java b/src/main/java/lol/pbu/z4j/model/Comment.java new file mode 100644 index 0000000..5d017dc --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Comment.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * Comment + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Comment.JSON_PROPERTY_BODY, + Comment.JSON_PROPERTY_LOCALE, + Comment.JSON_PROPERTY_AUTHOR_ID, + Comment.JSON_PROPERTY_CREATED_AT, + Comment.JSON_PROPERTY_HTML_URL, + Comment.JSON_PROPERTY_ID, + Comment.JSON_PROPERTY_NON_AUTHOR_EDITOR_ID, + Comment.JSON_PROPERTY_NON_AUTHOR_UPDATED_AT, + Comment.JSON_PROPERTY_SOURCE_ID, + Comment.JSON_PROPERTY_SOURCE_TYPE, + Comment.JSON_PROPERTY_UPDATED_AT, + Comment.JSON_PROPERTY_URL, + Comment.JSON_PROPERTY_VOTE_COUNT, + Comment.JSON_PROPERTY_VOTE_SUM, +}) +@Serdeable +public class Comment { + + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_NON_AUTHOR_EDITOR_ID = "non_author_editor_id"; + public static final String JSON_PROPERTY_NON_AUTHOR_UPDATED_AT = "non_author_updated_at"; + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + public static final String JSON_PROPERTY_SOURCE_TYPE = "source_type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_VOTE_COUNT = "vote_count"; + public static final String JSON_PROPERTY_VOTE_SUM = "vote_sum"; + + /** + * The comment made by the author. See User content + */ + @NotNull + @JsonProperty(JSON_PROPERTY_BODY) + private String body; + + /** + * The locale in which this comment was made + */ + @NotNull + @JsonProperty(JSON_PROPERTY_LOCALE) + private LocaleAbbreviation localeAbbreviation; + + /** + * The id of the author of this comment. Writable on create by Help Center managers. See Create Comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long authorId; + + /** + * The time the comment was created. Writable on create by Help Center managers. See Create Comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The url at which the comment is presented in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when the comment is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + *

The user id of whoever performed the most recent (if any) non-author edit.

A non-author edit consists of + * an edit make by a user other than the author that creates or updates the body or + * author_id. Note that only edits made after May 17, 2021, will be reflected in this field. + * If no non-author edits have occurred since May 17, 2021, then this field will benull. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_EDITOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long nonAuthorEditorId; + + /** + * When the comment was last edited by a non-author user + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime nonAuthorUpdatedAt; + + /** + * The id of the item on which this comment was made + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long sourceId; + + /** + * The type of the item on which this comment was made. Currently only supports 'Article' + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceType; + + /** + * The time at which the comment was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of this comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The total number of upvotes and downvotes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteCount; + + /** + * The sum of upvotes (+1) and downvotes (-1), which may be positive or negative + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_SUM) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteSum; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CommentResponse.java b/src/main/java/lol/pbu/z4j/model/CommentResponse.java new file mode 100644 index 0000000..e49f17d --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CommentResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CommentResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CommentResponse.JSON_PROPERTY_COMMENT) +@Serdeable +public class CommentResponse { + + public static final String JSON_PROPERTY_COMMENT = "comment"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Comment comment; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CommentsResponse.java b/src/main/java/lol/pbu/z4j/model/CommentsResponse.java new file mode 100644 index 0000000..546f8bf --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CommentsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * CommentsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CommentsResponse.JSON_PROPERTY_COMMENTS) +@Serdeable +public class CommentsResponse { + + public static final String JSON_PROPERTY_COMMENTS = "comments"; + + @Nullable + @JsonProperty(JSON_PROPERTY_COMMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Comment> comments; + + /** + * Add an item to the comments property in a chainable fashion. + * + * @return The same instance of CommentsResponse for chaining. + */ + public CommentsResponse addCommentsItem(Comment commentsItem) { + if (comments == null) { + comments = new ArrayList<>(); + } + comments.add(commentsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/CommunityPostSearchResponse.java b/src/main/java/lol/pbu/z4j/model/CommunityPostSearchResponse.java new file mode 100644 index 0000000..290eef5 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CommunityPostSearchResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * CommunityPostSearchResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CommunityPostSearchResponse.JSON_PROPERTY_RESULTS) +@Serdeable +public class CommunityPostSearchResponse { + + public static final String JSON_PROPERTY_RESULTS = "results"; + + @Nullable + @JsonProperty(JSON_PROPERTY_RESULTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Post> results; + + /** + * Add an item to the results property in a chainable fashion. + * + * @return The same instance of CommunityPostSearchResponse for chaining. + */ + public CommunityPostSearchResponse addResultsItem(Post resultsItem) { + if (results == null) { + results = new ArrayList<>(); + } + results.add(resultsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/ContentSubscription.java b/src/main/java/lol/pbu/z4j/model/ContentSubscription.java new file mode 100644 index 0000000..f8976da --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ContentSubscription.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ContentSubscription + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ContentSubscription.JSON_PROPERTY_LOCALE, + ContentSubscription.JSON_PROPERTY_CONTENT_ID, + ContentSubscription.JSON_PROPERTY_CONTENT_TYPE, + ContentSubscription.JSON_PROPERTY_CREATED_AT, + ContentSubscription.JSON_PROPERTY_ID, + ContentSubscription.JSON_PROPERTY_INCLUDE_COMMENTS, + ContentSubscription.JSON_PROPERTY_SOURCE_LOCALE, + ContentSubscription.JSON_PROPERTY_UPDATED_AT, + ContentSubscription.JSON_PROPERTY_URL, + ContentSubscription.JSON_PROPERTY_USER_ID, +}) +@Serdeable +public class ContentSubscription { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_CONTENT_ID = "content_id"; + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_INCLUDE_COMMENTS = "include_comments"; + public static final String JSON_PROPERTY_SOURCE_LOCALE = "source_locale"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_USER_ID = "user_id"; + + /** + * The locale of the subscribed item + */ + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private LocaleAbbreviation localeAbbreviation; + + /** + * The id of the subscribed item + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long contentId; + + /** + * The type of the subscribed item + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentType; + + /** + * The time at which the subscription was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * Automatically assigned when the subscription is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * Subscribe also to article comments / post comments. Only for section / topic subscriptions. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_COMMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean includeComments; + + /** + * Used only for Create Section Subscription and Create Article Subscription, where it's mandatory. Selects the locale of the content to be subscribed + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceLocale; + + /** + * The time at which the subscription was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of the subscription + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The id of the user who has this subscription + */ + @Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long userId; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ContentSubscriptionsResponse.java b/src/main/java/lol/pbu/z4j/model/ContentSubscriptionsResponse.java new file mode 100644 index 0000000..1e081a1 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ContentSubscriptionsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * ContentSubscriptionsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(ContentSubscriptionsResponse.JSON_PROPERTY_SUBSCRIPTIONS) +@Serdeable +public class ContentSubscriptionsResponse { + + public static final String JSON_PROPERTY_SUBSCRIPTIONS = "subscriptions"; + + @Nullable + @JsonProperty(JSON_PROPERTY_SUBSCRIPTIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid ContentSubscription> subscriptions; + + /** + * Add an item to the subscriptions property in a chainable fashion. + * + * @return The same instance of ContentSubscriptionsResponse for chaining. + */ + public ContentSubscriptionsResponse addSubscriptionsItem(ContentSubscription subscriptionsItem) { + if (subscriptions == null) { + subscriptions = new ArrayList<>(); + } + subscriptions.add(subscriptionsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/CreateCategoryRequest.java b/src/main/java/lol/pbu/z4j/model/CreateCategoryRequest.java new file mode 100644 index 0000000..2417be2 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CreateCategoryRequest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CreateCategoryRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CreateCategoryRequest.JSON_PROPERTY_CATEGORY) +@Serdeable +public class CreateCategoryRequest { + + public static final String JSON_PROPERTY_CATEGORY = "category"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Category category; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CreateUserImageResponse.java b/src/main/java/lol/pbu/z4j/model/CreateUserImageResponse.java new file mode 100644 index 0000000..66ad7ff --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CreateUserImageResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CreateUserImageResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CreateUserImageResponse.JSON_PROPERTY_USER_IMAGE) +@Serdeable +public class CreateUserImageResponse { + + public static final String JSON_PROPERTY_USER_IMAGE = "user_image"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_USER_IMAGE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private CreateUserImageResponseUserImage userImage; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CreateUserImageResponseUserImage.java b/src/main/java/lol/pbu/z4j/model/CreateUserImageResponseUserImage.java new file mode 100644 index 0000000..72851b9 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CreateUserImageResponseUserImage.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * CreateUserImageResponseUserImage + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + CreateUserImageResponseUserImage.JSON_PROPERTY_CONTENT_TYPE, + CreateUserImageResponseUserImage.JSON_PROPERTY_PATH, + CreateUserImageResponseUserImage.JSON_PROPERTY_SIZE, +}) +@Serdeable +public class CreateUserImageResponseUserImage { + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + public static final String JSON_PROPERTY_PATH = "path"; + public static final String JSON_PROPERTY_SIZE = "size"; + + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String contentType; + + @Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String path; + + @Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private BigDecimal size; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CreateUserSegmentRequest.java b/src/main/java/lol/pbu/z4j/model/CreateUserSegmentRequest.java new file mode 100644 index 0000000..a174df9 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CreateUserSegmentRequest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CreateUserSegmentRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CreateUserSegmentRequest.JSON_PROPERTY_USER_SEGMENT) +@Serdeable +public class CreateUserSegmentRequest { + + public static final String JSON_PROPERTY_USER_SEGMENT = "user_segment"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_USER_SEGMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private UserSegment userSegment; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CustomField.java b/src/main/java/lol/pbu/z4j/model/CustomField.java new file mode 100644 index 0000000..99658dd --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CustomField.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * CustomField + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(CustomField.JSON_PROPERTY_PROPERTIES) +@Serdeable +public class CustomField { + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private CustomFieldProperties properties; + +} diff --git a/src/main/java/lol/pbu/z4j/model/CustomFieldOption.java b/src/main/java/lol/pbu/z4j/model/CustomFieldOption.java new file mode 100644 index 0000000..38b36d2 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CustomFieldOption.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * CustomFieldOptionObject + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + CustomFieldOption.JSON_PROPERTY_NAME, + CustomFieldOption.JSON_PROPERTY_VALUE, + CustomFieldOption.JSON_PROPERTY_ID, + CustomFieldOption.JSON_PROPERTY_POSITION, + CustomFieldOption.JSON_PROPERTY_RAW_NAME, + CustomFieldOption.JSON_PROPERTY_URL, +}) +@Serdeable +public class CustomFieldOption { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_VALUE = "value"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_RAW_NAME = "raw_name"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * Name of the dropdown option + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * Value of the dropdown option + */ + @NotNull + @JsonProperty(JSON_PROPERTY_VALUE) + private String value; + + /** + * Automatically assigned upon creation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * Position of the dropdown option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer position; + + /** + * Raw name of the dropdown option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawName; + + /** + * URL of the dropdown option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + public CustomFieldOption(String name, String value) { + this.name = name; + this.value = value; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/CustomFieldProperties.java b/src/main/java/lol/pbu/z4j/model/CustomFieldProperties.java new file mode 100644 index 0000000..5383a89 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/CustomFieldProperties.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * A set of properties which describe the standard::name field's autonumbering and uniqueness behavior. Autonumbering and uniqueness can't be used together + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + CustomFieldProperties.JSON_PROPERTY_AUTOINCREMENT_ENABLED, + CustomFieldProperties.JSON_PROPERTY_AUTOINCREMENT_NEXT_SEQUENCE, + CustomFieldProperties.JSON_PROPERTY_AUTOINCREMENT_PADDING, + CustomFieldProperties.JSON_PROPERTY_AUTOINCREMENT_PREFIX, + CustomFieldProperties.JSON_PROPERTY_IS_UNIQUE, +}) +@Serdeable +public class CustomFieldProperties { + + public static final String JSON_PROPERTY_AUTOINCREMENT_ENABLED = "autoincrement_enabled"; + public static final String JSON_PROPERTY_AUTOINCREMENT_NEXT_SEQUENCE = "autoincrement_next_sequence"; + public static final String JSON_PROPERTY_AUTOINCREMENT_PADDING = "autoincrement_padding"; + public static final String JSON_PROPERTY_AUTOINCREMENT_PREFIX = "autoincrement_prefix"; + public static final String JSON_PROPERTY_IS_UNIQUE = "is_unique"; + + /** + * Turns autonumbering on or off + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTOINCREMENT_ENABLED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean autoincrementEnabled; + + /** + * The next number in the autonumbering sequence. It can't be negative or less than the current autonumbering value + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTOINCREMENT_NEXT_SEQUENCE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer autoincrementNextSequence; + + /** + * Sets the number of digits for autogenerated numbers. Valid values are 0-9 + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTOINCREMENT_PADDING) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer autoincrementPadding; + + /** + * A prefix to autogenerated numbers that can't exceed 30 characters + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTOINCREMENT_PREFIX) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String autoincrementPrefix; + + /** + * Turns uniqueness on or off + */ + @Nullable + @JsonProperty(JSON_PROPERTY_IS_UNIQUE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean isUnique; + +} diff --git a/src/main/java/lol/pbu/z4j/model/EmailCC.java b/src/main/java/lol/pbu/z4j/model/EmailCC.java new file mode 100644 index 0000000..02ede69 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/EmailCC.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * EmailCC + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + EmailCC.JSON_PROPERTY_ACTION, + EmailCC.JSON_PROPERTY_USER_EMAIL, + EmailCC.JSON_PROPERTY_USER_ID, + EmailCC.JSON_PROPERTY_USER_NAME, +}) +@Serdeable +public class EmailCC { + + public static final String JSON_PROPERTY_ACTION = "action"; + public static final String JSON_PROPERTY_USER_EMAIL = "user_email"; + public static final String JSON_PROPERTY_USER_ID = "user_id"; + public static final String JSON_PROPERTY_USER_NAME = "user_name"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private EmailCCAllOfAction action; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String userEmail; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String userId; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String userName; + +} diff --git a/src/main/java/lol/pbu/z4j/model/EmailCCAllOfAction.java b/src/main/java/lol/pbu/z4j/model/EmailCCAllOfAction.java new file mode 100644 index 0000000..35f65ec --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/EmailCCAllOfAction.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Gets or Sets EmailCC_allOf_action + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum EmailCCAllOfAction { + + @JsonProperty("put") + PUT("put"), + + @JsonProperty("delete") + DELETE("delete"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static EmailCCAllOfAction fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/Follower.java b/src/main/java/lol/pbu/z4j/model/Follower.java new file mode 100644 index 0000000..2aa5c9e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Follower.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.Email; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * Follower + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Follower.JSON_PROPERTY_ACTION, + Follower.JSON_PROPERTY_USER_EMAIL, + Follower.JSON_PROPERTY_USER_ID, +}) +@Serdeable +public class Follower { + + public static final String JSON_PROPERTY_ACTION = "action"; + public static final String JSON_PROPERTY_USER_EMAIL = "user_email"; + public static final String JSON_PROPERTY_USER_ID = "user_id"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private EmailCCAllOfAction action; + + @Nullable + @Email + @JsonProperty(JSON_PROPERTY_USER_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String userEmail; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String userId; + +} diff --git a/src/main/java/lol/pbu/z4j/model/HelpCenterLocalesResponse.java b/src/main/java/lol/pbu/z4j/model/HelpCenterLocalesResponse.java new file mode 100644 index 0000000..818dc70 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/HelpCenterLocalesResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * HelpCenterLocalesResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(HelpCenterLocalesResponse.JSON_PROPERTY_LOCALES) +@Serdeable +public class HelpCenterLocalesResponse { + + public static final String JSON_PROPERTY_LOCALES = "locales"; + + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull LocaleAbbreviation> localeAbbreviations; + + /** + * Add an item to the locales property in a chainable fashion. + * + * @return The same instance of HelpCenterLocalesResponse for chaining. + */ + public HelpCenterLocalesResponse addLocalesItem(LocaleAbbreviation localeAbbreviation) { + if (localeAbbreviations == null) { + localeAbbreviations = new ArrayList<>(); + } + localeAbbreviations.add(localeAbbreviation); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/HelpCenterSession.java b/src/main/java/lol/pbu/z4j/model/HelpCenterSession.java new file mode 100644 index 0000000..e4b7be8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/HelpCenterSession.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * HelpCenterSession + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(HelpCenterSession.JSON_PROPERTY_CSRF_TOKEN) +@Serdeable +public class HelpCenterSession { + + public static final String JSON_PROPERTY_CSRF_TOKEN = "csrf_token"; + + @Nullable + @JsonProperty(JSON_PROPERTY_CSRF_TOKEN) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String csrfToken; + +} diff --git a/src/main/java/lol/pbu/z4j/model/HelpCenterSessionResponse.java b/src/main/java/lol/pbu/z4j/model/HelpCenterSessionResponse.java new file mode 100644 index 0000000..d31beab --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/HelpCenterSessionResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * HelpCenterSessionResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(HelpCenterSessionResponse.JSON_PROPERTY_CURRENT_SESSION) +@Serdeable +public class HelpCenterSessionResponse { + + public static final String JSON_PROPERTY_CURRENT_SESSION = "current_session"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_CURRENT_SESSION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private HelpCenterSession currentSession; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Label.java b/src/main/java/lol/pbu/z4j/model/Label.java new file mode 100644 index 0000000..a11090d --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Label.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * Label + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Label.JSON_PROPERTY_NAME, + Label.JSON_PROPERTY_CREATED_AT, + Label.JSON_PROPERTY_ID, + Label.JSON_PROPERTY_UPDATED_AT, + Label.JSON_PROPERTY_URL, +}) +@Serdeable +public class Label { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The actual name of the label + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * The time at which the label was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * Automatically assigned when the label is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The time at which the label was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of this label + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + public Label(String name) { + this.name = name; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/LabelResponse.java b/src/main/java/lol/pbu/z4j/model/LabelResponse.java new file mode 100644 index 0000000..adac96d --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LabelResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * LabelResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(LabelResponse.JSON_PROPERTY_LABEL) +@Serdeable +public class LabelResponse { + + public static final String JSON_PROPERTY_LABEL = "label"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Label label; + +} diff --git a/src/main/java/lol/pbu/z4j/model/LabelsResponse.java b/src/main/java/lol/pbu/z4j/model/LabelsResponse.java new file mode 100644 index 0000000..768c3a9 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LabelsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * LabelsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(LabelsResponse.JSON_PROPERTY_LABELS) +@Serdeable +public class LabelsResponse { + + public static final String JSON_PROPERTY_LABELS = "labels"; + + @Nullable + @JsonProperty(JSON_PROPERTY_LABELS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Label> labels; + + /** + * Add an item to the labels property in a chainable fashion. + * + * @return The same instance of LabelsResponse for chaining. + */ + public LabelsResponse addLabelsItem(Label labelsItem) { + if (labels == null) { + labels = new ArrayList<>(); + } + labels.add(labelsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Locale.java b/src/main/java/lol/pbu/z4j/model/Locale.java new file mode 100644 index 0000000..46672e8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Locale.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * Locale + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Locale.JSON_PROPERTY_CREATED_AT, + Locale.JSON_PROPERTY_ID, + Locale.JSON_PROPERTY_LOCALE, + Locale.JSON_PROPERTY_NAME, + Locale.JSON_PROPERTY_UPDATED_AT, + Locale.JSON_PROPERTY_URL, +}) +@Serdeable +public class Locale { + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The ISO 8601 formatted date-time the locale was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * The unique ID of the locale + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The name of the locale + */ + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private LocaleAbbreviation localeAbbreviation; + + /** + * The name of the language + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + + /** + * The ISO 8601 formatted date-time when the locale was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + /** + * The URL of the locale record + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + +} diff --git a/src/main/java/lol/pbu/z4j/model/LocaleAbbreviation.java b/src/main/java/lol/pbu/z4j/model/LocaleAbbreviation.java new file mode 100644 index 0000000..518c3c2 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LocaleAbbreviation.java @@ -0,0 +1,170 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The locale of the translation + */ +@RequiredArgsConstructor +@Getter(onMethod = @__(@JsonValue)) +@Serdeable +public enum LocaleAbbreviation { + + @JsonProperty("ar") + ARABIC("ar"), + + @JsonProperty("pt-br") + PORTUGUESE_BRAZIL("pt-br"), + + @JsonProperty("bg") + BULGARIAN("bg"), + + @JsonProperty("cs") + CZECH("cs"), + + @JsonProperty("da") + DANISH("da"), + + @JsonProperty("nl") + DUTCH("nl"), + + @JsonProperty("en-gb") + ENGLISH_UNITED_KINGDOM("en-gb"), + + @JsonProperty("en-us") + ENGLISH_UNITED_STATES("en-us"), + + @JsonProperty("fa-af") + DARI_PERSIAN_AFGHANISTAN("fa-af"), + + @JsonProperty("fil") + FILIPINO("fil"), + + @JsonProperty("fi") + FINNISH("fi"), + + @JsonProperty("fr") + FRENCH("fr"), + + @JsonProperty("fr-ca") + FRENCH_CANADA("fr-ca"), + + @JsonProperty("de") + GERMAN("de"), + + @JsonProperty("el") + GREEK("el"), + + @JsonProperty("he") + HEBREW("he"), + + @JsonProperty("hi") + HINDI("hi"), + + @JsonProperty("hu") + HUNGARIAN("hu"), + + @JsonProperty("id") + INDONESIAN("id"), + + @JsonProperty("it") + ITALIAN("it"), + + @JsonProperty("ja") + JAPANESE("ja"), + + @JsonProperty("ko") + KOREAN("ko"), + + @JsonProperty("ms") + MALAY("ms"), + + @JsonProperty("false") + NORWEGIAN("false"), + + @JsonProperty("pl") + POLISH("pl"), + + @JsonProperty("ro") + ROMANIAN("ro"), + + @JsonProperty("ru") + RUSSIAN("ru"), + + @JsonProperty("zh-cn") + SIMPLIFIED_CHINESE("zh-cn"), + + @JsonProperty("es") + SPANISH("es"), + + @JsonProperty("sk") + SLOVAK("sk"), + + @JsonProperty("sv") + SWEDISH("sv"), + + @JsonProperty("th") + THAI("th"), + + @JsonProperty("zh-tw") + TRADITIONAL_CHINESE("zh-tw"), + + @JsonProperty("tr") + TURKISH("tr"), + + @JsonProperty("uk") + UKRAINIAN("uk"), + + @JsonProperty("vi") + VIETNAMESE("vi"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static LocaleAbbreviation fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value.toLowerCase())) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value.toLowerCase()); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} \ No newline at end of file diff --git a/src/main/java/lol/pbu/z4j/model/LocaleResponse.java b/src/main/java/lol/pbu/z4j/model/LocaleResponse.java new file mode 100644 index 0000000..74db8da --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LocaleResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * LocaleResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(LocaleResponse.JSON_PROPERTY_LOCALE) +@Serdeable +public class LocaleResponse { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Locale locale; + +} diff --git a/src/main/java/lol/pbu/z4j/model/LocalesResponse.java b/src/main/java/lol/pbu/z4j/model/LocalesResponse.java new file mode 100644 index 0000000..f209b14 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LocalesResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * LocalesResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(LocalesResponse.JSON_PROPERTY_LOCALES) +@Serdeable +public class LocalesResponse { + + public static final String JSON_PROPERTY_LOCALES = "locales"; + + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Locale> locales; + + /** + * Add an item to the locales property in a chainable fashion. + * + * @return The same instance of LocalesResponse for chaining. + */ + public LocalesResponse addLocalesItem(Locale localesItem) { + if (locales == null) { + locales = new ArrayList<>(); + } + locales.add(localesItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/LocalesWithDefaultResponse.java b/src/main/java/lol/pbu/z4j/model/LocalesWithDefaultResponse.java new file mode 100644 index 0000000..c65221f --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/LocalesWithDefaultResponse.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * LocalesWithDefaultResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + LocalesWithDefaultResponse.JSON_PROPERTY_DEFAULT_LOCALE, + LocalesWithDefaultResponse.JSON_PROPERTY_LOCALES, +}) +@Serdeable +public class LocalesWithDefaultResponse { + + public static final String JSON_PROPERTY_DEFAULT_LOCALE = "default_locale"; + public static final String JSON_PROPERTY_LOCALES = "locales"; + + @Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String defaultLocale; + + @Nullable + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull LocaleAbbreviation> localeAbbreviations; + + /** + * Add an item to the locales property in a chainable fashion. + * + * @return The same instance of LocalesWithDefaultResponse for chaining. + */ + public LocalesWithDefaultResponse addLocalesItem(LocaleAbbreviation localeAbbreviation) { + if (localeAbbreviations == null) { + localeAbbreviations = new ArrayList<>(); + } + localeAbbreviations.add(localeAbbreviation); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Post.java b/src/main/java/lol/pbu/z4j/model/Post.java new file mode 100644 index 0000000..19d392b --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Post.java @@ -0,0 +1,267 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * Post + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Post.JSON_PROPERTY_TITLE, + Post.JSON_PROPERTY_AUTHOR_ID, + Post.JSON_PROPERTY_CLOSED, + Post.JSON_PROPERTY_COMMENT_COUNT, + Post.JSON_PROPERTY_CONTENT_TAG_IDS, + Post.JSON_PROPERTY_CREATED_AT, + Post.JSON_PROPERTY_DETAILS, + Post.JSON_PROPERTY_FEATURED, + Post.JSON_PROPERTY_FOLLOWER_COUNT, + Post.JSON_PROPERTY_HTML_URL, + Post.JSON_PROPERTY_ID, + Post.JSON_PROPERTY_NON_AUTHOR_EDITOR_ID, + Post.JSON_PROPERTY_NON_AUTHOR_UPDATED_AT, + Post.JSON_PROPERTY_PINNED, + Post.JSON_PROPERTY_STATUS, + Post.JSON_PROPERTY_TOPIC_ID, + Post.JSON_PROPERTY_UPDATED_AT, + Post.JSON_PROPERTY_URL, + Post.JSON_PROPERTY_VOTE_COUNT, + Post.JSON_PROPERTY_VOTE_SUM, +}) +@Serdeable +public class Post { + + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_CLOSED = "closed"; + public static final String JSON_PROPERTY_COMMENT_COUNT = "comment_count"; + public static final String JSON_PROPERTY_CONTENT_TAG_IDS = "content_tag_ids"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DETAILS = "details"; + public static final String JSON_PROPERTY_FEATURED = "featured"; + public static final String JSON_PROPERTY_FOLLOWER_COUNT = "follower_count"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_NON_AUTHOR_EDITOR_ID = "non_author_editor_id"; + public static final String JSON_PROPERTY_NON_AUTHOR_UPDATED_AT = "non_author_updated_at"; + public static final String JSON_PROPERTY_PINNED = "pinned"; + public static final String JSON_PROPERTY_STATUS = "status"; + public static final String JSON_PROPERTY_TOPIC_ID = "topic_id"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_VOTE_COUNT = "vote_count"; + public static final String JSON_PROPERTY_VOTE_SUM = "vote_sum"; + + /** + * The title of the post + */ + @NotNull + @JsonProperty(JSON_PROPERTY_TITLE) + private String title; + + /** + * The id of the author of the post. *Writable on create by Help Center managers -- see Create Post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long authorId; + + /** + * Whether further comments are allowed + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CLOSED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean closed; + + /** + * The number of comments on the post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COMMENT_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long commentCount; + + /** + * The list of content tags attached to the post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TAG_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> contentTagIds; + + /** + * When the post was created. Writable on create by Help Center managers -- see Create Post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * The details of the post made by the author. See User content + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DETAILS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String details; + + /** + * Whether the post is featured + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FEATURED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean featured; + + /** + * The number of followers of the post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWER_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long followerCount; + + /** + * The community url of the post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when the post is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The user id of whoever performed the most recent (if any) non-author edit. A non-author edit consists of an edit make by a user other than the author that creates or updates the title or details. Note that only edits made after May 17, 2021 will be reflected in this field. If no non-author edits have occured since May 17, 2021, then this field will be null. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_EDITOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long nonAuthorEditorId; + + /** + * When the post was last edited by a non-author user + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime nonAuthorUpdatedAt; + + /** + * When true, pins the post to the top of its topic + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PINNED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean pinned; + + /** + * The status of the post. Possible values: \"planned\", \"not_planned\" , \"answered\", or \"completed\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String status; + + /** + * The id of the topic that the post belongs to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TOPIC_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long topicId; + + /** + * When the post was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + /** + * The API url of the post + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The total number of upvotes and downvotes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteCount; + + /** + * The sum of upvotes (+1) and downvotes (-1), which may be positive or negative + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_SUM) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteSum; + + public Post(String title) { + this.title = title; + } + + /** + * Add an item to the contentTagIds property in a chainable fashion. + * + * @return The same instance of Post for chaining. + */ + public Post addContentTagIdsItem(Long contentTagIdsItem) { + if (contentTagIds == null) { + contentTagIds = new ArrayList<>(); + } + contentTagIds.add(contentTagIdsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/PostComment.java b/src/main/java/lol/pbu/z4j/model/PostComment.java new file mode 100644 index 0000000..7843a38 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/PostComment.java @@ -0,0 +1,182 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * PostComment + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + PostComment.JSON_PROPERTY_BODY, + PostComment.JSON_PROPERTY_AUTHOR_ID, + PostComment.JSON_PROPERTY_CREATED_AT, + PostComment.JSON_PROPERTY_HTML_URL, + PostComment.JSON_PROPERTY_ID, + PostComment.JSON_PROPERTY_NON_AUTHOR_EDITOR_ID, + PostComment.JSON_PROPERTY_NON_AUTHOR_UPDATED_AT, + PostComment.JSON_PROPERTY_OFFICIAL, + PostComment.JSON_PROPERTY_POST_ID, + PostComment.JSON_PROPERTY_UPDATED_AT, + PostComment.JSON_PROPERTY_URL, + PostComment.JSON_PROPERTY_VOTE_COUNT, + PostComment.JSON_PROPERTY_VOTE_SUM, +}) +@Serdeable +public class PostComment implements SearchResultsInner { + + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_NON_AUTHOR_EDITOR_ID = "non_author_editor_id"; + public static final String JSON_PROPERTY_NON_AUTHOR_UPDATED_AT = "non_author_updated_at"; + public static final String JSON_PROPERTY_OFFICIAL = "official"; + public static final String JSON_PROPERTY_POST_ID = "post_id"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_VOTE_COUNT = "vote_count"; + public static final String JSON_PROPERTY_VOTE_SUM = "vote_sum"; + + /** + * The comment made by the author. See User content + */ + @NotNull + @JsonProperty(JSON_PROPERTY_BODY) + private String body; + + /** + * The id of the author of the comment. Writable on create by Help Center managers. See Create Post Comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long authorId; + + /** + * When the comment was created. Writable on create by Help Center managers. See Create Post Comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The community url of the comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when the comment is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The user id of whoever performed the most recent (if any) non-author edit. A non-author edit consists of an edit make by a user other than the author that creates or updates the body. Note that only edits made after May 17, 2021 will be reflected in this field. If no non-author edits have occured since May 17, 2021, then this field will be null. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_EDITOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long nonAuthorEditorId; + + /** + * When the comment was last edited by a non-author user + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NON_AUTHOR_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime nonAuthorUpdatedAt; + + /** + * Whether the comment is marked as official + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OFFICIAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean official; + + /** + * The id of the post on which the comment was made + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POST_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long postId; + + /** + * When the comment was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of the comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The total number of upvotes and downvotes + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteCount; + + /** + * The sum of upvotes (+1) and downvotes (-1), which may be positive or negative + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOTE_SUM) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long voteSum; + + public PostComment(String body) { + this.body = body; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/PostCommentResponse.java b/src/main/java/lol/pbu/z4j/model/PostCommentResponse.java new file mode 100644 index 0000000..a237a65 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/PostCommentResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * PostCommentResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(PostCommentResponse.JSON_PROPERTY_COMMENT) +@Serdeable +public class PostCommentResponse { + + public static final String JSON_PROPERTY_COMMENT = "comment"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private PostComment comment; + +} diff --git a/src/main/java/lol/pbu/z4j/model/PostCommentsResponse.java b/src/main/java/lol/pbu/z4j/model/PostCommentsResponse.java new file mode 100644 index 0000000..ba84ea4 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/PostCommentsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * PostCommentsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(PostCommentsResponse.JSON_PROPERTY_COMMENTS) +@Serdeable +public class PostCommentsResponse { + + public static final String JSON_PROPERTY_COMMENTS = "comments"; + + @Nullable + @JsonProperty(JSON_PROPERTY_COMMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid PostComment> comments; + + /** + * Add an item to the comments property in a chainable fashion. + * + * @return The same instance of PostCommentsResponse for chaining. + */ + public PostCommentsResponse addCommentsItem(PostComment commentsItem) { + if (comments == null) { + comments = new ArrayList<>(); + } + comments.add(commentsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/PostResponse.java b/src/main/java/lol/pbu/z4j/model/PostResponse.java new file mode 100644 index 0000000..63ec90f --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/PostResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * PostResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(PostResponse.JSON_PROPERTY_POST) +@Serdeable +public class PostResponse { + + public static final String JSON_PROPERTY_POST = "post"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_POST) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Post post; + +} diff --git a/src/main/java/lol/pbu/z4j/model/PostsResponse.java b/src/main/java/lol/pbu/z4j/model/PostsResponse.java new file mode 100644 index 0000000..2c8ed07 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/PostsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * PostsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(PostsResponse.JSON_PROPERTY_POSTS) +@Serdeable +public class PostsResponse { + + public static final String JSON_PROPERTY_POSTS = "posts"; + + @Nullable + @JsonProperty(JSON_PROPERTY_POSTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Post> posts; + + /** + * Add an item to the posts property in a chainable fashion. + * + * @return The same instance of PostsResponse for chaining. + */ + public PostsResponse addPostsItem(Post postsItem) { + if (posts == null) { + posts = new ArrayList<>(); + } + posts.add(postsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponse.java b/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponse.java new file mode 100644 index 0000000..12ada04 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * RequestUserImageUploadResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(RequestUserImageUploadResponse.JSON_PROPERTY_UPLOAD) +@Serdeable +public class RequestUserImageUploadResponse { + + public static final String JSON_PROPERTY_UPLOAD = "upload"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_UPLOAD) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private RequestUserImageUploadResponseUpload upload; + +} diff --git a/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponseUpload.java b/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponseUpload.java new file mode 100644 index 0000000..c8dde7e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/RequestUserImageUploadResponseUpload.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.HashMap; +import java.util.Map; + +/** + * RequestUserImageUploadResponseUpload + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + RequestUserImageUploadResponseUpload.JSON_PROPERTY_HEADERS, + RequestUserImageUploadResponseUpload.JSON_PROPERTY_TOKEN, + RequestUserImageUploadResponseUpload.JSON_PROPERTY_URL, +}) +@Serdeable +public class RequestUserImageUploadResponseUpload { + + public static final String JSON_PROPERTY_HEADERS = "headers"; + public static final String JSON_PROPERTY_TOKEN = "token"; + public static final String JSON_PROPERTY_URL = "url"; + + @Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map headers; + + @Nullable + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String token; + + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * Set the value for the key for the headers map property in a chainable fashion. + * + * @return The same instance of RequestUserImageUploadResponseUpload for chaining. + */ + public RequestUserImageUploadResponseUpload putHeadersItem(String key, Object headersItem) { + if (headers == null) { + headers = new HashMap<>(); + } + headers.put(key, headersItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Search.java b/src/main/java/lol/pbu/z4j/model/Search.java new file mode 100644 index 0000000..0167974 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Search.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * Search + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder(Search.JSON_PROPERTY_RESULTS) +@Serdeable +public class Search { + + public static final String JSON_PROPERTY_RESULTS = "results"; + + /** + * An array with the base articles or community posts + */ + @NotNull + @JsonProperty(JSON_PROPERTY_RESULTS) + private List<@Valid SearchResultsInner> results = new ArrayList<>(); + + public Search(List<@Valid SearchResultsInner> results) { + this.results = results; + } + + /** + * Add an item to the results property in a chainable fashion. + * + * @return The same instance of Search for chaining. + */ + public Search addResultsItem(SearchResultsInner resultsItem) { + results.add(resultsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/SearchExportType.java b/src/main/java/lol/pbu/z4j/model/SearchExportType.java new file mode 100644 index 0000000..16b7426 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SearchExportType.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Gets or Sets SearchExportType + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SearchExportType { + + @JsonProperty("ticket") + TICKET("ticket"), + + @JsonProperty("organization") + ORGANIZATION("organization"), + + @JsonProperty("user") + USER("user"), + + @JsonProperty("group") + GROUP("group"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SearchExportType fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SearchResponse.java b/src/main/java/lol/pbu/z4j/model/SearchResponse.java new file mode 100644 index 0000000..04df544 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SearchResponse.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * SearchResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + SearchResponse.JSON_PROPERTY_COUNT, + SearchResponse.JSON_PROPERTY_FACETS, + SearchResponse.JSON_PROPERTY_NEXT_PAGE, + SearchResponse.JSON_PROPERTY_PREVIOUS_PAGE, + SearchResponse.JSON_PROPERTY_RESULTS, +}) +@Serdeable +public class SearchResponse { + + public static final String JSON_PROPERTY_COUNT = "count"; + public static final String JSON_PROPERTY_FACETS = "facets"; + public static final String JSON_PROPERTY_NEXT_PAGE = "next_page"; + public static final String JSON_PROPERTY_PREVIOUS_PAGE = "previous_page"; + public static final String JSON_PROPERTY_RESULTS = "results"; + + /** + * The number of resources returned by the query corresponding to this page of results in the paginated response + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer count; + + /** + * The facets corresponding to the search query + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FACETS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String facets; + + /** + * URL to the next page of results + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NEXT_PAGE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String nextPage; + + /** + * URL to the previous page of results + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PREVIOUS_PAGE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String previousPage; + + /** + * May consist of tickets, users, groups, or organizations, as specified by the `result_type` property in each result object + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RESULTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid SearchResult> results; + +} diff --git a/src/main/java/lol/pbu/z4j/model/SearchResult.java b/src/main/java/lol/pbu/z4j/model/SearchResult.java new file mode 100644 index 0000000..ee1ca63 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SearchResult.java @@ -0,0 +1,134 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * SearchResult + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + SearchResult.JSON_PROPERTY_CREATED_AT, + SearchResult.JSON_PROPERTY_DEFAULT, + SearchResult.JSON_PROPERTY_DELETED, + SearchResult.JSON_PROPERTY_DESCRIPTION, + SearchResult.JSON_PROPERTY_ID, + SearchResult.JSON_PROPERTY_NAME, + SearchResult.JSON_PROPERTY_RESULT_TYPE, + SearchResult.JSON_PROPERTY_UPDATED_AT, + SearchResult.JSON_PROPERTY_URL, +}) +@Serdeable +public class SearchResult { + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DEFAULT = "default"; + public static final String JSON_PROPERTY_DELETED = "deleted"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_RESULT_TYPE = "result_type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * When the resource was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * Flag to indicate whether this is the default resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean isDefault; + + /** + * Flag to indicate whether resource has been deleted + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DELETED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean deleted; + + /** + * The description of the resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The ID of the resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer id; + + /** + * The name of the resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + + /** + * The type of the resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RESULT_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String resultType; + + /** + * When the resource was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The url of the resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + +} diff --git a/src/main/java/lol/pbu/z4j/model/SearchResultsInner.java b/src/main/java/lol/pbu/z4j/model/SearchResultsInner.java new file mode 100644 index 0000000..880fe5e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SearchResultsInner.java @@ -0,0 +1,23 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import io.micronaut.serde.annotation.Serdeable; + +@Serdeable +public interface SearchResultsInner { + +} diff --git a/src/main/java/lol/pbu/z4j/model/Section.java b/src/main/java/lol/pbu/z4j/model/Section.java new file mode 100644 index 0000000..439f6a8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Section.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * Section + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Section.JSON_PROPERTY_LOCALE, + Section.JSON_PROPERTY_NAME, + Section.JSON_PROPERTY_CATEGORY_ID, + Section.JSON_PROPERTY_CREATED_AT, + Section.JSON_PROPERTY_DESCRIPTION, + Section.JSON_PROPERTY_HTML_URL, + Section.JSON_PROPERTY_ID, + Section.JSON_PROPERTY_OUTDATED, + Section.JSON_PROPERTY_PARENT_SECTION_ID, + Section.JSON_PROPERTY_POSITION, + Section.JSON_PROPERTY_SOURCE_LOCALE, + Section.JSON_PROPERTY_THEME_TEMPLATE, + Section.JSON_PROPERTY_UPDATED_AT, + Section.JSON_PROPERTY_URL, +}) +@Serdeable +public class Section { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_CATEGORY_ID = "category_id"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_OUTDATED = "outdated"; + public static final String JSON_PROPERTY_PARENT_SECTION_ID = "parent_section_id"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_SOURCE_LOCALE = "source_locale"; + public static final String JSON_PROPERTY_THEME_TEMPLATE = "theme_template"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The locale in which the section is displayed + */ + @NotNull + @JsonProperty(JSON_PROPERTY_LOCALE) + private LocaleAbbreviation localeAbbreviation; + + /** + * The name of the section + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * The id of the category to which this section belongs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long categoryId; + + /** + * The time at which the section was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The description of the section + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The url of this section in HC + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when creating subscriptions + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * Whether the section is out of date + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OUTDATED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean outdated; + + /** + * The id of the section to which this section belongs. Only writable for Guide Enterprise customers + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PARENT_SECTION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long parentSectionId; + + /** + * The position of this section in the section list. Used when sorting is set to ´manual´. By default the section is added to the end of the list + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long position; + + /** + * The source (default) locale of the section + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_LOCALE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceLocale; + + /** + * The theme template name used to display this section in Help Center. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_THEME_TEMPLATE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String themeTemplate; + + /** + * The time at which the section was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of this section + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + public Section(LocaleAbbreviation localeAbbreviation, String name) { + this.localeAbbreviation = localeAbbreviation; + this.name = name; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/SectionPutRequest.java b/src/main/java/lol/pbu/z4j/model/SectionPutRequest.java new file mode 100644 index 0000000..769af45 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SectionPutRequest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * SectionPutRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder(SectionPutRequest.JSON_PROPERTY_SECTION) +@Serdeable +public class SectionPutRequest { + + public static final String JSON_PROPERTY_SECTION = "section"; + + @NotNull + @Valid + @JsonProperty(JSON_PROPERTY_SECTION) + private SectionPutRequestSection section; + + public SectionPutRequest(SectionPutRequestSection section) { + this.section = section; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/SectionPutRequestSection.java b/src/main/java/lol/pbu/z4j/model/SectionPutRequestSection.java new file mode 100644 index 0000000..aa8accf --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SectionPutRequestSection.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * SectionPutRequestSection + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + SectionPutRequestSection.JSON_PROPERTY_CATEGORY_ID, + SectionPutRequestSection.JSON_PROPERTY_DESCRIPTION, + SectionPutRequestSection.JSON_PROPERTY_NAME, + SectionPutRequestSection.JSON_PROPERTY_PARENT_SECTION_ID, + SectionPutRequestSection.JSON_PROPERTY_POSITION, + SectionPutRequestSection.JSON_PROPERTY_SORTING, + SectionPutRequestSection.JSON_PROPERTY_THEME_TEMPLATE, +}) +@Serdeable +public class SectionPutRequestSection { + + public static final String JSON_PROPERTY_CATEGORY_ID = "category_id"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_PARENT_SECTION_ID = "parent_section_id"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_SORTING = "sorting"; + public static final String JSON_PROPERTY_THEME_TEMPLATE = "theme_template"; + + /** + * The id of the category to which this section belongs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long categoryId; + + /** + * The description of the section + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The name of the section + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + + /** + * The id of the section to which this section belongs. Only writable for Guide Enterprise customers + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PARENT_SECTION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long parentSectionId; + + /** + * The position of this section in the section list. Used when sorting is set to ´manual´. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long position; + + @Nullable + @JsonProperty(JSON_PROPERTY_SORTING) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private SectionPutRequestSectionSorting sorting; + + /** + * The theme template name used to display this section in Help Center. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_THEME_TEMPLATE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String themeTemplate; + +} diff --git a/src/main/java/lol/pbu/z4j/model/SectionPutRequestSectionSorting.java b/src/main/java/lol/pbu/z4j/model/SectionPutRequestSectionSorting.java new file mode 100644 index 0000000..6a63a3f --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SectionPutRequestSectionSorting.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Defines the type of sorting used in this section + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SectionPutRequestSectionSorting { + + @JsonProperty("manual") + MANUAL("manual"), + + @JsonProperty("title") + TITLE("title"), + + @JsonProperty("creation_desc") + CREATION_DESC("creation_desc"), + + @JsonProperty("creation_asc") + CREATION_ASC("creation_asc"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + @Override + public String toString() { + return String.valueOf(value); + } + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SectionPutRequestSectionSorting fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SectionResponse.java b/src/main/java/lol/pbu/z4j/model/SectionResponse.java new file mode 100644 index 0000000..a7ce8e9 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SectionResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * SectionResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(SectionResponse.JSON_PROPERTY_SECTION) +@Serdeable +public class SectionResponse { + + public static final String JSON_PROPERTY_SECTION = "section"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_SECTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Section section; + +} diff --git a/src/main/java/lol/pbu/z4j/model/SectionsResponse.java b/src/main/java/lol/pbu/z4j/model/SectionsResponse.java new file mode 100644 index 0000000..f1fc7d8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SectionsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * SectionsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(SectionsResponse.JSON_PROPERTY_SECTIONS) +@Serdeable +public class SectionsResponse { + + public static final String JSON_PROPERTY_SECTIONS = "sections"; + + @Nullable + @JsonProperty(JSON_PROPERTY_SECTIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Section> sections; + + /** + * Add an item to the sections property in a chainable fashion. + * + * @return The same instance of SectionsResponse for chaining. + */ + public SectionsResponse addSectionsItem(Section sectionsItem) { + if (sections == null) { + sections = new ArrayList<>(); + } + sections.add(sectionsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/SortArticleBy.java b/src/main/java/lol/pbu/z4j/model/SortArticleBy.java new file mode 100644 index 0000000..aa7885f --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SortArticleBy.java @@ -0,0 +1,73 @@ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lol.pbu.z4j.client.CategoryClient; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Provides the 'sort by' options when querying Articles.
+ * See {@link CategoryClient} + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SortArticleBy { + /** + * Order set manually using the Arrange Content page. + *

Default order if no other order is selected

+ */ + POSITION("position"), + /** + * Order alphabetically by title. Must specify a locale in associated query + */ + TITLE("title"), + /** + * Order by creation time + */ + CREATED_AT("created_at"), + /** + * Order by update time + */ + UPDATED_AT("updated_at"), + /** + * Order by the last time the title or body was edited. Must specify a locale in associated query + */ + EDITED_AT("edited_at"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SortArticleBy fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SortBy.java b/src/main/java/lol/pbu/z4j/model/SortBy.java new file mode 100644 index 0000000..1b5c30d --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SortBy.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Provides the 'sort by' options for various use cases. + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SortBy { + + UPDATED_AT("updated_at"), + + CREATED_AT("created_at"), + + PRIORITY("priority"), + + STATUS("status"), + + TICKET_TYPE("ticket_type"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SortBy fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SortCategoryBy.java b/src/main/java/lol/pbu/z4j/model/SortCategoryBy.java new file mode 100644 index 0000000..ba45df6 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SortCategoryBy.java @@ -0,0 +1,66 @@ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lol.pbu.z4j.client.CategoryClient; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Provides the 'sort by' options when querying categories.
+ * See {@link CategoryClient} + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SortCategoryBy { + /** + * order set manually using the Arrange Content page. Default order + */ + POSITION("position"), + + /** + * order by creation time + */ + CREATED_AT("created_at"), + + /** + * order by update time + */ + UPDATED_AT("updated_at"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SortCategoryBy fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SortOrder.java b/src/main/java/lol/pbu/z4j/model/SortOrder.java new file mode 100644 index 0000000..06e3348 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SortOrder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Gets or Sets a basic sort order, which only includes ascending and descending options + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum SortOrder { + + @JsonProperty("asc") + ASCENDING("asc"), + + @JsonProperty("desc") + DESCENDING("desc"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static SortOrder fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/SubscriptionResponse.java b/src/main/java/lol/pbu/z4j/model/SubscriptionResponse.java new file mode 100644 index 0000000..2640621 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SubscriptionResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * SubscriptionResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(SubscriptionResponse.JSON_PROPERTY_SUBSCRIPTION) +@Serdeable +public class SubscriptionResponse { + + public static final String JSON_PROPERTY_SUBSCRIPTION = "subscription"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_SUBSCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ContentSubscription subscription; + +} diff --git a/src/main/java/lol/pbu/z4j/model/SystemFieldOptionObject.java b/src/main/java/lol/pbu/z4j/model/SystemFieldOptionObject.java new file mode 100644 index 0000000..9fd07de --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/SystemFieldOptionObject.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * SystemFieldOptionObject + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + SystemFieldOptionObject.JSON_PROPERTY_NAME, + SystemFieldOptionObject.JSON_PROPERTY_VALUE, +}) +@Serdeable +public class SystemFieldOptionObject { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_VALUE = "value"; + + /** + * Name of the system field option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + + /** + * Value of the system field option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String value; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Ticket.java b/src/main/java/lol/pbu/z4j/model/Ticket.java new file mode 100644 index 0000000..691f3d9 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Ticket.java @@ -0,0 +1,692 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Ticket + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Ticket.JSON_PROPERTY_REQUESTER_ID, + Ticket.JSON_PROPERTY_ALLOW_ATTACHMENTS, + Ticket.JSON_PROPERTY_ALLOW_CHANNELBACK, + Ticket.JSON_PROPERTY_ASSIGNEE_EMAIL, + Ticket.JSON_PROPERTY_ASSIGNEE_ID, + Ticket.JSON_PROPERTY_ATTRIBUTE_VALUE_IDS, + Ticket.JSON_PROPERTY_BRAND_ID, + Ticket.JSON_PROPERTY_COLLABORATOR_IDS, + Ticket.JSON_PROPERTY_COLLABORATORS, + Ticket.JSON_PROPERTY_COMMENT, + Ticket.JSON_PROPERTY_CREATED_AT, + Ticket.JSON_PROPERTY_CUSTOM_FIELDS, + Ticket.JSON_PROPERTY_CUSTOM_STATUS_ID, + Ticket.JSON_PROPERTY_DESCRIPTION, + Ticket.JSON_PROPERTY_DUE_AT, + Ticket.JSON_PROPERTY_EMAIL_CC_IDS, + Ticket.JSON_PROPERTY_EMAIL_CCS, + Ticket.JSON_PROPERTY_EXTERNAL_ID, + Ticket.JSON_PROPERTY_FOLLOWER_IDS, + Ticket.JSON_PROPERTY_FOLLOWERS, + Ticket.JSON_PROPERTY_FOLLOWUP_IDS, + Ticket.JSON_PROPERTY_FORUM_TOPIC_ID, + Ticket.JSON_PROPERTY_FROM_MESSAGING_CHANNEL, + Ticket.JSON_PROPERTY_GENERATED_TIMESTAMP, + Ticket.JSON_PROPERTY_GROUP_ID, + Ticket.JSON_PROPERTY_HAS_INCIDENTS, + Ticket.JSON_PROPERTY_ID, + Ticket.JSON_PROPERTY_IS_PUBLIC, + Ticket.JSON_PROPERTY_MACRO_ID, + Ticket.JSON_PROPERTY_MACRO_IDS, + Ticket.JSON_PROPERTY_METADATA, + Ticket.JSON_PROPERTY_ORGANIZATION_ID, + Ticket.JSON_PROPERTY_PRIORITY, + Ticket.JSON_PROPERTY_PROBLEM_ID, + Ticket.JSON_PROPERTY_RAW_SUBJECT, + Ticket.JSON_PROPERTY_RECIPIENT, + Ticket.JSON_PROPERTY_REQUESTER, + Ticket.JSON_PROPERTY_SAFE_UPDATE, + Ticket.JSON_PROPERTY_SATISFACTION_RATING, + Ticket.JSON_PROPERTY_SHARING_AGREEMENT_IDS, + Ticket.JSON_PROPERTY_STATUS, + Ticket.JSON_PROPERTY_SUBJECT, + Ticket.JSON_PROPERTY_SUBMITTER_ID, + Ticket.JSON_PROPERTY_TAGS, + Ticket.JSON_PROPERTY_TICKET_FORM_ID, + Ticket.JSON_PROPERTY_TYPE, + Ticket.JSON_PROPERTY_UPDATED_AT, + Ticket.JSON_PROPERTY_UPDATED_STAMP, + Ticket.JSON_PROPERTY_URL, + Ticket.JSON_PROPERTY_VIA, + Ticket.JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID, + Ticket.JSON_PROPERTY_VIA_ID, + Ticket.JSON_PROPERTY_VOICE_COMMENT, +}) +@Serdeable +public class Ticket { + + public static final String JSON_PROPERTY_REQUESTER_ID = "requester_id"; + public static final String JSON_PROPERTY_ALLOW_ATTACHMENTS = "allow_attachments"; + public static final String JSON_PROPERTY_ALLOW_CHANNELBACK = "allow_channelback"; + public static final String JSON_PROPERTY_ASSIGNEE_EMAIL = "assignee_email"; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + public static final String JSON_PROPERTY_ATTRIBUTE_VALUE_IDS = "attribute_value_ids"; + public static final String JSON_PROPERTY_BRAND_ID = "brand_id"; + public static final String JSON_PROPERTY_COLLABORATOR_IDS = "collaborator_ids"; + public static final String JSON_PROPERTY_COLLABORATORS = "collaborators"; + public static final String JSON_PROPERTY_COMMENT = "comment"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + public static final String JSON_PROPERTY_CUSTOM_STATUS_ID = "custom_status_id"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_DUE_AT = "due_at"; + public static final String JSON_PROPERTY_EMAIL_CC_IDS = "email_cc_ids"; + public static final String JSON_PROPERTY_EMAIL_CCS = "email_ccs"; + public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id"; + public static final String JSON_PROPERTY_FOLLOWER_IDS = "follower_ids"; + public static final String JSON_PROPERTY_FOLLOWERS = "followers"; + public static final String JSON_PROPERTY_FOLLOWUP_IDS = "followup_ids"; + public static final String JSON_PROPERTY_FORUM_TOPIC_ID = "forum_topic_id"; + public static final String JSON_PROPERTY_FROM_MESSAGING_CHANNEL = "from_messaging_channel"; + public static final String JSON_PROPERTY_GENERATED_TIMESTAMP = "generated_timestamp"; + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + public static final String JSON_PROPERTY_HAS_INCIDENTS = "has_incidents"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_IS_PUBLIC = "is_public"; + public static final String JSON_PROPERTY_MACRO_ID = "macro_id"; + public static final String JSON_PROPERTY_MACRO_IDS = "macro_ids"; + public static final String JSON_PROPERTY_METADATA = "metadata"; + public static final String JSON_PROPERTY_ORGANIZATION_ID = "organization_id"; + public static final String JSON_PROPERTY_PRIORITY = "priority"; + public static final String JSON_PROPERTY_PROBLEM_ID = "problem_id"; + public static final String JSON_PROPERTY_RAW_SUBJECT = "raw_subject"; + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + public static final String JSON_PROPERTY_REQUESTER = "requester"; + public static final String JSON_PROPERTY_SAFE_UPDATE = "safe_update"; + public static final String JSON_PROPERTY_SATISFACTION_RATING = "satisfaction_rating"; + public static final String JSON_PROPERTY_SHARING_AGREEMENT_IDS = "sharing_agreement_ids"; + public static final String JSON_PROPERTY_STATUS = "status"; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + public static final String JSON_PROPERTY_SUBMITTER_ID = "submitter_id"; + public static final String JSON_PROPERTY_TAGS = "tags"; + public static final String JSON_PROPERTY_TICKET_FORM_ID = "ticket_form_id"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_UPDATED_STAMP = "updated_stamp"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_VIA = "via"; + public static final String JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID = "via_followup_source_id"; + public static final String JSON_PROPERTY_VIA_ID = "via_id"; + public static final String JSON_PROPERTY_VOICE_COMMENT = "voice_comment"; + + /** + * The user who requested this ticket + */ + @NotNull + @JsonProperty(JSON_PROPERTY_REQUESTER_ID) + private Long requesterId; + + /** + * Permission for agents to add attachments to a comment. Defaults to true + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_ATTACHMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean allowAttachments; + + /** + * Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_CHANNELBACK) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean allowChannelback; + + /** + * Write only. The email address of the agent to assign the ticket to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String assigneeEmail; + + /** + * The agent currently assigned to the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long assigneeId; + + /** + * Write only. An array of the IDs of attribute values to be associated with the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_VALUE_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> attributeValueIds; + + /** + * The id of the brand this ticket is associated with. See Setting up multiple brands + */ + @Nullable + @JsonProperty(JSON_PROPERTY_BRAND_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long brandId; + + /** + * The ids of users currently CC'ed on the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLABORATOR_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> collaboratorIds; + + /** + * POST requests only. Users to add as cc's when creating a ticket. See Setting Collaborators + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLABORATORS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Collaborator> collaborators; + + /** + * Write only. An object that adds a comment to the ticket. See Ticket comments. To include an attachment with the comment, see Attaching files. A ticket can contain up to 5000 comments in total, including both public and private comments. Once this limit is reached, any additional attempts to add comments results in a 422 error. The ticket can still be updated in other ways, provided that no new comments are added. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object comment; + + /** + * When this record was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * Custom fields for the ticket. See Setting custom field values + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid TicketCustomFieldsInner> customFields; + + /** + * The custom ticket status id of the ticket. See custom ticket statuses + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_STATUS_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long customStatusId; + + /** + * Read-only first comment on the ticket. When creating a ticket, use comment to set the description. See Description and first comment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DUE_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime dueAt; + + /** + * The ids of agents or end users currently CC'ed on the ticket. Ignored when CCs and followers is not enabled + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CC_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> emailCcIds; + + /** + * Write only. An array of objects that represents agent or end users email CCs to add or delete from the ticket. See Setting email CCs. Ignored when CCs and followers is not enabled + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CCS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object emailCcs; + + /** + * An id you can use to link Zendesk Support tickets to local records + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String externalId; + + /** + * The ids of agents currently following the ticket. Ignored when CCs and followers is not enabled + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWER_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> followerIds; + + /** + * Write only. An array of objects that represents agent followers to add or delete from the ticket. See Setting followers. Ignored when CCs and followers is not enabled + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWERS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object followers; + + /** + * The ids of the followups created from this ticket. Ids are only visible once the ticket is closed + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWUP_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> followupIds; + + /** + * The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FORUM_TOPIC_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long forumTopicId; + + /** + * If true, the ticket's via type is a messaging channel. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FROM_MESSAGING_CHANNEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean fromMessagingChannel; + + /** + * A Unix timestamp that represents the most accurate reading of when this record was last updated. It is updated for all ticket updates, including system updates + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GENERATED_TIMESTAMP) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long generatedTimestamp; + + /** + * The group this ticket is assigned to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long groupId; + + /** + * Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HAS_INCIDENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean hasIncidents; + + /** + * Automatically assigned when the ticket is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * Is true if any comments are public, false otherwise + */ + @Nullable + @JsonProperty(JSON_PROPERTY_IS_PUBLIC) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean isPublic; + + /** + * Write only. A macro ID to be recorded in the ticket audit + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MACRO_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long macroId; + + /** + * POST requests only. List of macro IDs to be recorded in the ticket audit + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MACRO_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> macroIds; + + /** + * Write only. Metadata for the audit. In the audit object, the data is specified in the custom property of the metadata object. See Setting Metadata + */ + @Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object metadata; + + /** + * The organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ORGANIZATION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long organizationId; + + @Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketPriority priority; + + /** + * For tickets of type \"incident\", the ID of the problem the incident is linked to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PROBLEM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long problemId; + + /** + * The dynamic content placeholder, if present, or the \"subject\" value, if not. See Dynamic Content Items + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_SUBJECT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawSubject; + + /** + * The original recipient e-mail address of the ticket. Notification emails for the ticket are sent from this address + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String recipient; + + /** + * Write only. See Creating a ticket with a new requester + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object requester; + + /** + * Write only. Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. See Protecting against ticket update collisions. A value of false has the same effect as true. Omit the property to force the updates to not be safe + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SAFE_UPDATE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean safeUpdate; + + /** + * The satisfaction rating of the ticket, if it exists, or the state of satisfaction, \"offered\" or \"unoffered\". The value is null for plan types that don't support CSAT + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SATISFACTION_RATING) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map satisfactionRating; + + /** + * The ids of the sharing agreements used for this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SHARING_AGREEMENT_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> sharingAgreementIds; + + @Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketStatus status; + + /** + * The value of the subject field for this ticket. See Subject + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String subject; + + /** + * The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUBMITTER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long submitterId; + + /** + * The array of tags applied to this ticket. Unless otherwise specified, the set tag behavior is used, which overwrites and replaces existing tags + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> tags; + + /** + * Enterprise only. The id of the ticket form to render for the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TICKET_FORM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long ticketFormId; + + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketType type; + + /** + * When this record last got updated. It is updated only if the update generates a ticket event + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + /** + * Write only. Datetime of last update received from API. See the safe_update property + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_STAMP) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedStamp; + + /** + * The API url of this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VIA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketVia via; + + /** + * POST requests only. The id of a closed ticket when creating a follow-up ticket. See Creating a follow-up ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long viaFollowupSourceId; + + /** + * Write only. For more information, see the Via object reference + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VIA_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long viaId; + + /** + * Write only. See Creating voicemail ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VOICE_COMMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object voiceComment; + + public Ticket(Long requesterId) { + this.requesterId = requesterId; + } + + /** + * Add an item to the attributeValueIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addAttributeValueIdsItem(Long attributeValueIdsItem) { + if (attributeValueIds == null) { + attributeValueIds = new ArrayList<>(); + } + attributeValueIds.add(attributeValueIdsItem); + return this; + } + + /** + * Add an item to the collaboratorIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addCollaboratorIdsItem(Long collaboratorIdsItem) { + if (collaboratorIds == null) { + collaboratorIds = new ArrayList<>(); + } + collaboratorIds.add(collaboratorIdsItem); + return this; + } + + /** + * Add an item to the collaborators property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addCollaboratorsItem(Collaborator collaboratorsItem) { + if (collaborators == null) { + collaborators = new ArrayList<>(); + } + collaborators.add(collaboratorsItem); + return this; + } + + /** + * Add an item to the customFields property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addCustomFieldsItem(TicketCustomFieldsInner customFieldsItem) { + if (customFields == null) { + customFields = new ArrayList<>(); + } + customFields.add(customFieldsItem); + return this; + } + + /** + * Add an item to the emailCcIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addEmailCcIdsItem(Long emailCcIdsItem) { + if (emailCcIds == null) { + emailCcIds = new ArrayList<>(); + } + emailCcIds.add(emailCcIdsItem); + return this; + } + + /** + * Add an item to the followerIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addFollowerIdsItem(Long followerIdsItem) { + if (followerIds == null) { + followerIds = new ArrayList<>(); + } + followerIds.add(followerIdsItem); + return this; + } + + /** + * Add an item to the macroIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addMacroIdsItem(Long macroIdsItem) { + if (macroIds == null) { + macroIds = new ArrayList<>(); + } + macroIds.add(macroIdsItem); + return this; + } + + /** + * Add an item to the sharingAgreementIds property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addSharingAgreementIdsItem(Long sharingAgreementIdsItem) { + if (sharingAgreementIds == null) { + sharingAgreementIds = new ArrayList<>(); + } + sharingAgreementIds.add(sharingAgreementIdsItem); + return this; + } + + /** + * Add an item to the tags property in a chainable fashion. + * + * @return The same instance of Ticket for chaining. + */ + public Ticket addTagsItem(String tagsItem) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(tagsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketAuditVia.java b/src/main/java/lol/pbu/z4j/model/TicketAuditVia.java new file mode 100644 index 0000000..ae9d644 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketAuditVia.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Map; + +/** + * Describes how the object was created. See the Via object reference + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketAuditVia.JSON_PROPERTY_CHANNEL, + TicketAuditVia.JSON_PROPERTY_SOURCE, +}) +@Serdeable +public class TicketAuditVia { + + public static final String JSON_PROPERTY_CHANNEL = "channel"; + public static final String JSON_PROPERTY_SOURCE = "source"; + + /** + * This tells you how the ticket or event was created. Examples: \"web\", \"mobile\", \"rule\", \"system\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String channel; + + /** + * For some channels a source object gives more information about how or why the ticket or event was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map source; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketComment.java b/src/main/java/lol/pbu/z4j/model/TicketComment.java new file mode 100644 index 0000000..e5797a5 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketComment.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * TicketComment + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketComment.JSON_PROPERTY_ATTACHMENTS, + TicketComment.JSON_PROPERTY_AUDIT_ID, + TicketComment.JSON_PROPERTY_AUTHOR_ID, + TicketComment.JSON_PROPERTY_BODY, + TicketComment.JSON_PROPERTY_CREATED_AT, + TicketComment.JSON_PROPERTY_HTML_BODY, + TicketComment.JSON_PROPERTY_ID, + TicketComment.JSON_PROPERTY_METADATA, + TicketComment.JSON_PROPERTY_PLAIN_BODY, + TicketComment.JSON_PROPERTY_PUBLIC, + TicketComment.JSON_PROPERTY_TYPE, + TicketComment.JSON_PROPERTY_UPLOADS, + TicketComment.JSON_PROPERTY_VIA, +}) +@Serdeable +public class TicketComment { + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + public static final String JSON_PROPERTY_AUDIT_ID = "audit_id"; + public static final String JSON_PROPERTY_AUTHOR_ID = "author_id"; + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_HTML_BODY = "html_body"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_METADATA = "metadata"; + public static final String JSON_PROPERTY_PLAIN_BODY = "plain_body"; + public static final String JSON_PROPERTY_PUBLIC = "public"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_UPLOADS = "uploads"; + public static final String JSON_PROPERTY_VIA = "via"; + + /** + * Attachments, if any. See Attachment + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Attachment> attachments; + + /** + * The id of the ticket audit record. See Show Audit + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUDIT_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer auditId; + + /** + * The id of the comment author. See Author id + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer authorId; + + /** + * The comment string. See Bodies + */ + @Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String body; + + /** + * The time the comment was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * The comment formatted as HTML. See Bodies + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlBody; + + /** + * Automatically assigned when the comment is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer id; + + /** + * System information (web client, IP address, etc.) and comment flags, if any. See Comment flags + */ + @Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map metadata; + + /** + * The comment presented as plain text. See Bodies + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PLAIN_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String plainBody; + + /** + * true if a public comment; false if an internal note. The initial value set on ticket creation persists for any additional comment unless you change it + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean isPublic; + + /** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See Adding voice comments to tickets + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String type; + + /** + * List of tokens received from uploading files for comment attachments. The files are attached by creating or updating tickets with the tokens. See Attaching files in Tickets + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPLOADS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> uploads; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VIA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketAuditVia via; + + /** + * Add an item to the uploads property in a chainable fashion. + * + * @return The same instance of TicketComment for chaining. + */ + public TicketComment addUploadsItem(String uploadsItem) { + if (uploads == null) { + uploads = new ArrayList<>(); + } + uploads.add(uploadsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketCountResponse.java b/src/main/java/lol/pbu/z4j/model/TicketCountResponse.java new file mode 100644 index 0000000..35eac18 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketCountResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketCountResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketCountResponse.JSON_PROPERTY_COUNT) +@Serdeable +public class TicketCountResponse { + + public static final String JSON_PROPERTY_COUNT = "count"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketCountResponseCount count; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketCountResponseCount.java b/src/main/java/lol/pbu/z4j/model/TicketCountResponseCount.java new file mode 100644 index 0000000..f8ef468 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketCountResponseCount.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * TicketCountResponseCount + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketCountResponseCount.JSON_PROPERTY_REFRESHED_AT, + TicketCountResponseCount.JSON_PROPERTY_VALUE, +}) +@Serdeable +public class TicketCountResponseCount { + + public static final String JSON_PROPERTY_REFRESHED_AT = "refreshed_at"; + public static final String JSON_PROPERTY_VALUE = "value"; + + @Nullable + @JsonProperty(JSON_PROPERTY_REFRESHED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime refreshedAt; + + @Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long value; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketCreateInput.java b/src/main/java/lol/pbu/z4j/model/TicketCreateInput.java new file mode 100644 index 0000000..47e5374 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketCreateInput.java @@ -0,0 +1,550 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * TicketCreateInput + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + TicketCreateInput.JSON_PROPERTY_COMMENT, + TicketCreateInput.JSON_PROPERTY_ADDITIONAL_COLLABORATORS, + TicketCreateInput.JSON_PROPERTY_ASSIGNEE_EMAIL, + TicketCreateInput.JSON_PROPERTY_ASSIGNEE_ID, + TicketCreateInput.JSON_PROPERTY_ATTRIBUTE_VALUE_IDS, + TicketCreateInput.JSON_PROPERTY_COLLABORATOR_IDS, + TicketCreateInput.JSON_PROPERTY_CUSTOM_FIELDS, + TicketCreateInput.JSON_PROPERTY_CUSTOM_STATUS_ID, + TicketCreateInput.JSON_PROPERTY_DUE_AT, + TicketCreateInput.JSON_PROPERTY_EMAIL_CCS, + TicketCreateInput.JSON_PROPERTY_EXTERNAL_ID, + TicketCreateInput.JSON_PROPERTY_FOLLOWERS, + TicketCreateInput.JSON_PROPERTY_GROUP_ID, + TicketCreateInput.JSON_PROPERTY_ORGANIZATION_ID, + TicketCreateInput.JSON_PROPERTY_PRIORITY, + TicketCreateInput.JSON_PROPERTY_PROBLEM_ID, + TicketCreateInput.JSON_PROPERTY_REQUESTER_ID, + TicketCreateInput.JSON_PROPERTY_SAFE_UPDATE, + TicketCreateInput.JSON_PROPERTY_SHARING_AGREEMENT_IDS, + TicketCreateInput.JSON_PROPERTY_STATUS, + TicketCreateInput.JSON_PROPERTY_SUBJECT, + TicketCreateInput.JSON_PROPERTY_TAGS, + TicketCreateInput.JSON_PROPERTY_TYPE, + TicketCreateInput.JSON_PROPERTY_UPDATED_STAMP, + TicketCreateInput.JSON_PROPERTY_BRAND_ID, + TicketCreateInput.JSON_PROPERTY_COLLABORATORS, + TicketCreateInput.JSON_PROPERTY_EMAIL_CC_IDS, + TicketCreateInput.JSON_PROPERTY_FOLLOWER_IDS, + TicketCreateInput.JSON_PROPERTY_MACRO_IDS, + TicketCreateInput.JSON_PROPERTY_RAW_SUBJECT, + TicketCreateInput.JSON_PROPERTY_RECIPIENT, + TicketCreateInput.JSON_PROPERTY_SUBMITTER_ID, + TicketCreateInput.JSON_PROPERTY_TICKET_FORM_ID, + TicketCreateInput.JSON_PROPERTY_VIA, + TicketCreateInput.JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID, +}) +@Serdeable +public class TicketCreateInput { + + public static final String JSON_PROPERTY_COMMENT = "comment"; + public static final String JSON_PROPERTY_ADDITIONAL_COLLABORATORS = "additional_collaborators"; + public static final String JSON_PROPERTY_ASSIGNEE_EMAIL = "assignee_email"; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + public static final String JSON_PROPERTY_ATTRIBUTE_VALUE_IDS = "attribute_value_ids"; + public static final String JSON_PROPERTY_COLLABORATOR_IDS = "collaborator_ids"; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + public static final String JSON_PROPERTY_CUSTOM_STATUS_ID = "custom_status_id"; + public static final String JSON_PROPERTY_DUE_AT = "due_at"; + public static final String JSON_PROPERTY_EMAIL_CCS = "email_ccs"; + public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id"; + public static final String JSON_PROPERTY_FOLLOWERS = "followers"; + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + public static final String JSON_PROPERTY_ORGANIZATION_ID = "organization_id"; + public static final String JSON_PROPERTY_PRIORITY = "priority"; + public static final String JSON_PROPERTY_PROBLEM_ID = "problem_id"; + public static final String JSON_PROPERTY_REQUESTER_ID = "requester_id"; + public static final String JSON_PROPERTY_SAFE_UPDATE = "safe_update"; + public static final String JSON_PROPERTY_SHARING_AGREEMENT_IDS = "sharing_agreement_ids"; + public static final String JSON_PROPERTY_STATUS = "status"; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + public static final String JSON_PROPERTY_TAGS = "tags"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_UPDATED_STAMP = "updated_stamp"; + public static final String JSON_PROPERTY_BRAND_ID = "brand_id"; + public static final String JSON_PROPERTY_COLLABORATORS = "collaborators"; + public static final String JSON_PROPERTY_EMAIL_CC_IDS = "email_cc_ids"; + public static final String JSON_PROPERTY_FOLLOWER_IDS = "follower_ids"; + public static final String JSON_PROPERTY_MACRO_IDS = "macro_ids"; + public static final String JSON_PROPERTY_RAW_SUBJECT = "raw_subject"; + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + public static final String JSON_PROPERTY_SUBMITTER_ID = "submitter_id"; + public static final String JSON_PROPERTY_TICKET_FORM_ID = "ticket_form_id"; + public static final String JSON_PROPERTY_VIA = "via"; + public static final String JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID = "via_followup_source_id"; + + @NotNull + @Valid + @JsonProperty(JSON_PROPERTY_COMMENT) + private TicketComment comment; + + /** + * An array of numeric IDs, emails, or objects containing name and email properties. See Setting Collaborators. An email notification is sent to them when the ticket is updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_COLLABORATORS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Collaborator> additionalCollaborators; + + /** + * The email address of the agent to assign the ticket to + */ + @Nullable + @Email + @JsonProperty(JSON_PROPERTY_ASSIGNEE_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String assigneeEmail; + + /** + * The agent currently assigned to the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer assigneeId; + + /** + * An array of the IDs of attribute values to be associated with the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_VALUE_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> attributeValueIds; + + /** + * The ids of users currently CC'ed on the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLABORATOR_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> collaboratorIds; + + /** + * Custom fields for the ticket. See Setting custom field values + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid CustomField> customFields; + + /** + * The custom ticket status id of the ticket. See custom ticket statuses + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_STATUS_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer customStatusId; + + /** + * If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DUE_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime dueAt; + + /** + * An array of objects that represent agent or end users email CCs to add or delete from the ticket. See Setting email CCs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CCS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid EmailCC> emailCcs; + + /** + * An id you can use to link Zendesk Support tickets to local records + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String externalId; + + /** + * An array of objects that represent agent followers to add or delete from the ticket. See Setting followers + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWERS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Follower> followers; + + /** + * The group this ticket is assigned to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer groupId; + + /** + * The organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ORGANIZATION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer organizationId; + + @Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputPriority priority; + + /** + * For tickets of type \"incident\", the ID of the problem the incident is linked to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PROBLEM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer problemId; + + /** + * The user who requested this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer requesterId; + + /** + * Optional boolean. Prevents updates with outdated ticket data (`updated_stamp` property required when true) + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SAFE_UPDATE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean safeUpdate; + + /** + * An array of the numeric IDs of sharing agreements. Note that this replaces any existing agreements + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SHARING_AGREEMENT_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> sharingAgreementIds; + + @Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputStatus status; + + /** + * The value of the subject field for this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String subject; + + /** + * The array of tags applied to this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> tags; + + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputType type; + + /** + * Datetime of last update received from API. See the safe_update property + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_STAMP) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedStamp; + + /** + * Enterprise only. The id of the brand this ticket is associated with + */ + @Nullable + @JsonProperty(JSON_PROPERTY_BRAND_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long brandId; + + /** + * POST requests only. Users to add as cc's when creating a ticket. See Setting Collaborators + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLABORATORS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Collaborator> collaborators; + + /** + * The ids of agents or end users currently CC'ed on the ticket. See CCs and followers resources in the Support Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CC_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> emailCcIds; + + /** + * The ids of agents currently following the ticket. See CCs and followers resources + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWER_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> followerIds; + + /** + * POST requests only. List of macro IDs to be recorded in the ticket audit + */ + @Nullable + @JsonProperty(JSON_PROPERTY_MACRO_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> macroIds; + + /** + * The dynamic content placeholder, if present, or the \"subject\" value, if not. See Dynamic Content Items + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_SUBJECT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawSubject; + + /** + * The original recipient e-mail address of the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String recipient; + + /** + * The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUBMITTER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long submitterId; + + /** + * Enterprise only. The id of the ticket form to render for the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TICKET_FORM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long ticketFormId; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VIA) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Via via; + + /** + * POST requests only. The id of a closed ticket when creating a follow-up ticket. See Creating a follow-up ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VIA_FOLLOWUP_SOURCE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long viaFollowupSourceId; + + public TicketCreateInput(TicketComment comment) { + this.comment = comment; + } + + /** + * Add an item to the additionalCollaborators property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addAdditionalCollaboratorsItem(Collaborator additionalCollaboratorsItem) { + if (additionalCollaborators == null) { + additionalCollaborators = new ArrayList<>(); + } + additionalCollaborators.add(additionalCollaboratorsItem); + return this; + } + + /** + * Add an item to the attributeValueIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addAttributeValueIdsItem(Integer attributeValueIdsItem) { + if (attributeValueIds == null) { + attributeValueIds = new ArrayList<>(); + } + attributeValueIds.add(attributeValueIdsItem); + return this; + } + + /** + * Add an item to the collaboratorIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addCollaboratorIdsItem(Integer collaboratorIdsItem) { + if (collaboratorIds == null) { + collaboratorIds = new ArrayList<>(); + } + collaboratorIds.add(collaboratorIdsItem); + return this; + } + + /** + * Add an item to the customFields property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addCustomFieldsItem(CustomField customFieldsItem) { + if (customFields == null) { + customFields = new ArrayList<>(); + } + customFields.add(customFieldsItem); + return this; + } + + /** + * Add an item to the emailCcs property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addEmailCcsItem(EmailCC emailCcsItem) { + if (emailCcs == null) { + emailCcs = new ArrayList<>(); + } + emailCcs.add(emailCcsItem); + return this; + } + + /** + * Add an item to the followers property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addFollowersItem(Follower followersItem) { + if (followers == null) { + followers = new ArrayList<>(); + } + followers.add(followersItem); + return this; + } + + /** + * Add an item to the sharingAgreementIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addSharingAgreementIdsItem(Integer sharingAgreementIdsItem) { + if (sharingAgreementIds == null) { + sharingAgreementIds = new ArrayList<>(); + } + sharingAgreementIds.add(sharingAgreementIdsItem); + return this; + } + + /** + * Add an item to the tags property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addTagsItem(String tagsItem) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(tagsItem); + return this; + } + + /** + * Add an item to the collaborators property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addCollaboratorsItem(Collaborator collaboratorsItem) { + if (collaborators == null) { + collaborators = new ArrayList<>(); + } + collaborators.add(collaboratorsItem); + return this; + } + + /** + * Add an item to the emailCcIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addEmailCcIdsItem(Long emailCcIdsItem) { + if (emailCcIds == null) { + emailCcIds = new ArrayList<>(); + } + emailCcIds.add(emailCcIdsItem); + return this; + } + + /** + * Add an item to the followerIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addFollowerIdsItem(Long followerIdsItem) { + if (followerIds == null) { + followerIds = new ArrayList<>(); + } + followerIds.add(followerIdsItem); + return this; + } + + /** + * Add an item to the macroIds property in a chainable fashion. + * + * @return The same instance of TicketCreateInput for chaining. + */ + public TicketCreateInput addMacroIdsItem(Long macroIdsItem) { + if (macroIds == null) { + macroIds = new ArrayList<>(); + } + macroIds.add(macroIdsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketCreateRequest.java b/src/main/java/lol/pbu/z4j/model/TicketCreateRequest.java new file mode 100644 index 0000000..0cb704b --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketCreateRequest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketCreateRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketCreateRequest.JSON_PROPERTY_TICKET) +@Serdeable +public class TicketCreateRequest { + + public static final String JSON_PROPERTY_TICKET = "ticket"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TICKET) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketCreateInput ticket; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketCustomFieldsInner.java b/src/main/java/lol/pbu/z4j/model/TicketCustomFieldsInner.java new file mode 100644 index 0000000..5109289 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketCustomFieldsInner.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketCustomFieldsInner + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketCustomFieldsInner.JSON_PROPERTY_ID, + TicketCustomFieldsInner.JSON_PROPERTY_VALUE, +}) +@Serdeable +public class TicketCustomFieldsInner { + + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_VALUE = "value"; + + /** + * The id of the custom field + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The value of the custom field + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String value; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketField.java b/src/main/java/lol/pbu/z4j/model/TicketField.java new file mode 100644 index 0000000..85c5a5f --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketField.java @@ -0,0 +1,378 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * TicketFieldObject + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + TicketField.JSON_PROPERTY_TITLE, + TicketField.JSON_PROPERTY_TYPE, + TicketField.JSON_PROPERTY_ACTIVE, + TicketField.JSON_PROPERTY_AGENT_CAN_EDIT, + TicketField.JSON_PROPERTY_AGENT_DESCRIPTION, + TicketField.JSON_PROPERTY_COLLAPSED_FOR_AGENTS, + TicketField.JSON_PROPERTY_CREATED_AT, + TicketField.JSON_PROPERTY_CREATOR_APP_NAME, + TicketField.JSON_PROPERTY_CREATOR_USER_ID, + TicketField.JSON_PROPERTY_CUSTOM_FIELD_OPTIONS, + TicketField.JSON_PROPERTY_CUSTOM_STATUSES, + TicketField.JSON_PROPERTY_DESCRIPTION, + TicketField.JSON_PROPERTY_EDITABLE_IN_PORTAL, + TicketField.JSON_PROPERTY_ID, + TicketField.JSON_PROPERTY_POSITION, + TicketField.JSON_PROPERTY_RAW_DESCRIPTION, + TicketField.JSON_PROPERTY_RAW_TITLE, + TicketField.JSON_PROPERTY_RAW_TITLE_IN_PORTAL, + TicketField.JSON_PROPERTY_REGEXP_FOR_VALIDATION, + TicketField.JSON_PROPERTY_RELATIONSHIP_FILTER, + TicketField.JSON_PROPERTY_RELATIONSHIP_TARGET_TYPE, + TicketField.JSON_PROPERTY_REMOVABLE, + TicketField.JSON_PROPERTY_REQUIRED, + TicketField.JSON_PROPERTY_REQUIRED_IN_PORTAL, + TicketField.JSON_PROPERTY_SUB_TYPE_ID, + TicketField.JSON_PROPERTY_SYSTEM_FIELD_OPTIONS, + TicketField.JSON_PROPERTY_TAG, + TicketField.JSON_PROPERTY_TITLE_IN_PORTAL, + TicketField.JSON_PROPERTY_UPDATED_AT, + TicketField.JSON_PROPERTY_URL, + TicketField.JSON_PROPERTY_VISIBLE_IN_PORTAL, +}) +@Serdeable +public class TicketField { + + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_ACTIVE = "active"; + public static final String JSON_PROPERTY_AGENT_CAN_EDIT = "agent_can_edit"; + public static final String JSON_PROPERTY_AGENT_DESCRIPTION = "agent_description"; + public static final String JSON_PROPERTY_COLLAPSED_FOR_AGENTS = "collapsed_for_agents"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_CREATOR_APP_NAME = "creator_app_name"; + public static final String JSON_PROPERTY_CREATOR_USER_ID = "creator_user_id"; + public static final String JSON_PROPERTY_CUSTOM_FIELD_OPTIONS = "custom_field_options"; + public static final String JSON_PROPERTY_CUSTOM_STATUSES = "custom_statuses"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_EDITABLE_IN_PORTAL = "editable_in_portal"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_RAW_DESCRIPTION = "raw_description"; + public static final String JSON_PROPERTY_RAW_TITLE = "raw_title"; + public static final String JSON_PROPERTY_RAW_TITLE_IN_PORTAL = "raw_title_in_portal"; + public static final String JSON_PROPERTY_REGEXP_FOR_VALIDATION = "regexp_for_validation"; + public static final String JSON_PROPERTY_RELATIONSHIP_FILTER = "relationship_filter"; + public static final String JSON_PROPERTY_RELATIONSHIP_TARGET_TYPE = "relationship_target_type"; + public static final String JSON_PROPERTY_REMOVABLE = "removable"; + public static final String JSON_PROPERTY_REQUIRED = "required"; + public static final String JSON_PROPERTY_REQUIRED_IN_PORTAL = "required_in_portal"; + public static final String JSON_PROPERTY_SUB_TYPE_ID = "sub_type_id"; + public static final String JSON_PROPERTY_SYSTEM_FIELD_OPTIONS = "system_field_options"; + public static final String JSON_PROPERTY_TAG = "tag"; + public static final String JSON_PROPERTY_TITLE_IN_PORTAL = "title_in_portal"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_VISIBLE_IN_PORTAL = "visible_in_portal"; + + /** + * The title of the ticket field + */ + @NotNull + @JsonProperty(JSON_PROPERTY_TITLE) + private String title; + + /** + * System or custom field type. Editable for custom field types and only on creation. See Create Ticket Field + */ + @NotNull + @JsonProperty(JSON_PROPERTY_TYPE) + private String type; + + /** + * Whether this field is available + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean active; + + /** + * Whether this field is editable by agents + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AGENT_CAN_EDIT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean agentCanEdit; + + /** + * A description of the ticket field that only agents can see + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AGENT_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String agentDescription; + + /** + * If true, the field is shown to agents by default. If false, the field is hidden alongside infrequently used fields. Classic interface only + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLAPSED_FOR_AGENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean collapsedForAgents; + + /** + * The time the custom ticket field was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * Name of the app that created the ticket field, or a null value if no app created the ticket field + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATOR_APP_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String creatorAppName; + + /** + * The id of the user that created the ticket field, or a value of \"-1\" if an app created the ticket field + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATOR_USER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long creatorUserId; + + /** + * Required and presented for a custom ticket field of type \"multiselect\" or \"tagger\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELD_OPTIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid CustomFieldOption> customFieldOptions; + + /** + * List of customized ticket statuses. Only presented for a system ticket field of type \"custom_status\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_STATUSES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid TicketFieldCustomStatusObject> customStatuses; + + /** + * Describes the purpose of the ticket field to users + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * Whether this field is editable by end users in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EDITABLE_IN_PORTAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean editableInPortal; + + /** + * Automatically assigned when created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The relative position of the ticket field on a ticket. Note that for accounts with ticket forms, positions are controlled by the different forms + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer position; + + /** + * The dynamic content placeholder if present, or the description value if not. See Dynamic Content + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawDescription; + + /** + * The dynamic content placeholder if present, or the title value if not. See Dynamic Content + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_TITLE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawTitle; + + /** + * The dynamic content placeholder if present, or the \"title_in_portal\" value if not. See Dynamic Content + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RAW_TITLE_IN_PORTAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rawTitleInPortal; + + /** + * For \"regexp\" fields only. The validation pattern for a field value to be deemed valid + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REGEXP_FOR_VALIDATION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String regexpForValidation; + + /** + * A filter definition that allows your autocomplete to filter down results + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIP_FILTER) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Object relationshipFilter; + + /** + * A representation of what type of object the field references. Options are \"zen:user\", \"zen:organization\", \"zen:ticket\", or \"zen:custom_object:{key}\" where key is a custom object key. For example \"zen:custom_object:apartment\". + */ + @Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIP_TARGET_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String relationshipTargetType; + + /** + * If false, this field is a system field that must be present on all tickets + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REMOVABLE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean removable; + + /** + * If true, agents must enter a value in the field to change the ticket status to solved + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean required; + + /** + * If true, end users must enter a value in the field to create the request + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED_IN_PORTAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean requiredInPortal; + + /** + * For system ticket fields of type \"priority\" and \"status\". Defaults to 0. A \"priority\" sub type of 1 removes the \"Low\" and \"Urgent\" options. A \"status\" sub type of 1 adds the \"On-Hold\" option + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUB_TYPE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer subTypeId; + + /** + * Presented for a system ticket field of type \"tickettype\", \"priority\" or \"status\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SYSTEM_FIELD_OPTIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid SystemFieldOptionObject> systemFieldOptions; + + /** + * For \"checkbox\" fields only. A tag added to tickets when the checkbox field is selected + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String tag; + + /** + * The title of the ticket field for end users in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TITLE_IN_PORTAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String titleInPortal; + + /** + * The time the custom ticket field was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + /** + * The URL for this resource + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * Whether this field is visible to end users in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_VISIBLE_IN_PORTAL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean visibleInPortal; + + public TicketField(String title, String type) { + this.title = title; + this.type = type; + } + + /** + * Add an item to the customFieldOptions property in a chainable fashion. + * + * @return The same instance of TicketFieldObject for chaining. + */ + public TicketField addCustomFieldOptionsItem(CustomFieldOption customFieldOptionsItem) { + if (customFieldOptions == null) { + customFieldOptions = new ArrayList<>(); + } + customFieldOptions.add(customFieldOptionsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldCreateRequest.java b/src/main/java/lol/pbu/z4j/model/TicketFieldCreateRequest.java new file mode 100644 index 0000000..6365d4b --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldCreateRequest.java @@ -0,0 +1,16 @@ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Data +@NoArgsConstructor +@AllArgsConstructor +public class TicketFieldCreateRequest { + @JsonProperty("ticket_field") + private TicketField ticketField; +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObject.java b/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObject.java new file mode 100644 index 0000000..adfb061 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObject.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * TicketFieldCustomStatusObject + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketFieldCustomStatusObject.JSON_PROPERTY_ACTIVE, + TicketFieldCustomStatusObject.JSON_PROPERTY_AGENT_LABEL, + TicketFieldCustomStatusObject.JSON_PROPERTY_CREATED_AT, + TicketFieldCustomStatusObject.JSON_PROPERTY_DEFAULT, + TicketFieldCustomStatusObject.JSON_PROPERTY_DESCRIPTION, + TicketFieldCustomStatusObject.JSON_PROPERTY_END_USER_DESCRIPTION, + TicketFieldCustomStatusObject.JSON_PROPERTY_END_USER_LABEL, + TicketFieldCustomStatusObject.JSON_PROPERTY_ID, + TicketFieldCustomStatusObject.JSON_PROPERTY_STATUS_CATEGORY, + TicketFieldCustomStatusObject.JSON_PROPERTY_UPDATED_AT, +}) +@Serdeable +public class TicketFieldCustomStatusObject { + + public static final String JSON_PROPERTY_ACTIVE = "active"; + public static final String JSON_PROPERTY_AGENT_LABEL = "agent_label"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DEFAULT = "default"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_END_USER_DESCRIPTION = "end_user_description"; + public static final String JSON_PROPERTY_END_USER_LABEL = "end_user_label"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_STATUS_CATEGORY = "status_category"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + + /** + * If true, if the custom status is set to active. If false, the custom status is set to inactive + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean active; + + /** + * The label displayed to agents + */ + @Nullable + @JsonProperty(JSON_PROPERTY_AGENT_LABEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String agentLabel; + + /** + * The date and time at which the custom ticket status was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime createdAt; + + /** + * If true, the custom status is set to default. If false, the custom status is set to non-default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean isDefault; + + /** + * The description of when the user should select this custom ticket status + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The description displayed to end users + */ + @Nullable + @JsonProperty(JSON_PROPERTY_END_USER_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String endUserDescription; + + /** + * The label displayed to end users + */ + @Nullable + @JsonProperty(JSON_PROPERTY_END_USER_LABEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String endUserLabel; + + /** + * Automatically assigned when the custom ticket status is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + @Nullable + @JsonProperty(JSON_PROPERTY_STATUS_CATEGORY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketFieldCustomStatusObjectStatusCategory statusCategory; + + /** + * The date and time at which the custom ticket status was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObjectStatusCategory.java b/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObjectStatusCategory.java new file mode 100644 index 0000000..b457f9c --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldCustomStatusObjectStatusCategory.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The status category the custom ticket status belongs to + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketFieldCustomStatusObjectStatusCategory { + + @JsonProperty("new") + NEW("new"), + + @JsonProperty("open") + OPEN("open"), + + @JsonProperty("pending") + PENDING("pending"), + + @JsonProperty("hold") + HOLD("hold"), + + @JsonProperty("solved") + SOLVED("solved"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketFieldCustomStatusObjectStatusCategory fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldResponse.java b/src/main/java/lol/pbu/z4j/model/TicketFieldResponse.java new file mode 100644 index 0000000..32f6b7e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketFieldResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketFieldResponse.JSON_PROPERTY_TICKET_FIELD) +@Serdeable +public class TicketFieldResponse { + + public static final String JSON_PROPERTY_TICKET_FIELD = "ticket_field"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TICKET_FIELD) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketField ticketField; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldTypeEnum.java b/src/main/java/lol/pbu/z4j/model/TicketFieldTypeEnum.java new file mode 100644 index 0000000..64bd763 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldTypeEnum.java @@ -0,0 +1,147 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lol.pbu.z4j.client.TicketClient; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + *

All available custom field types.

+ * Create a new Ticket Field with {@link TicketClient#createTicketField} ()} + * See Zendesk KB for more info + * + *
    + *
  • {@link #TEXT} - Add a few words
  • + *
  • {@link #TEXT_AREA} - Add a few lines of text
  • + *
  • {@link #CHECKBOX} - Add a yes or no option
  • + *
  • {@link #DATE} - Select a date from a calendar
  • + *
  • {@link #INTEGER} - Enter a number with no decimal
  • + *
  • {@link #DECIMAL} - Enter a number with a decimal
  • + *
  • {@link #REGEXP} - Format regular expressions (Example: dates, URLs)
  • + *
  • {@link #PARTIAL_CREDIT_CARD} - Add a payment card number
  • + *
  • {@link #MULTI_SELECT} - Choose one or more options in a pre-set list
  • + *
  • {@link #TAGGER} - Drop-down: Choose one option in a menu of choices
  • + *
  • {@link #LOOKUP} - Link objects (Example: ticket to user, ticket to ticket)
  • + *
+ * + *

Note: Tags can't be re-used across custom ticket fields. For example, if you configure + * a tag for a checkbox field, you can't use that tag value for a dropdown (tagger) field option. The use of tags + * isn't validated and can prevent editing in the future.

+ * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketFieldTypeEnum { + + /** + *

Add a few words.

Default custom field type when type is not specified.

+ */ + @JsonProperty("text") TEXT("text"), + + /** + *

Add a few lines of text.

For multi-line text.

+ */ + @JsonProperty("textarea") TEXT_AREA("textarea"), + + /** + *

Add a yes or no option.

To capture a boolean value. Allowed values are true or false.

+ *

Optionally, you can specify a tag to be added to the ticket when the value is true.

+ */ + @JsonProperty("checkbox") CHECKBOX("checkbox"), + + /** + *

Select a date from a calendar.

Example: 2021-04-16.

+ */ + @JsonProperty("date") DATE("date"), + + /** + *

Enter a number with no decimal.

String composed of numbers.

+ */ + @JsonProperty("integer") INTEGER("integer"), + + /** + *

Enter a number with a decimal.

For numbers containing decimals.

+ */ + @JsonProperty("decimal") DECIMAL("decimal"), + + /** + *

Format regular expressions.

Matches the Regex pattern found in the custom field settings.

Example: dates, URLs

+ */ + @JsonProperty("regexp") REGEXP("regexp"), + + /** + *

Add a payment card number.

A credit card number. Only the last 4 digits are retained.

+ */ + @JsonProperty("partial_credit_card") PARTIAL_CREDIT_CARD("partial_credit_card"), + + /** + *

Select one or more options in a menu of options.

+ *

It contains one or more tag values belonging to the field's options. {@see #TAGGER}

+ */ + @JsonProperty("multi-select") MULTI_SELECT("multi-select"), + + /** + *

Single-select dropdown menu options.

+ *

It contains one or more tag values belonging to the field's options. {@see #MULTI_SELECT}

+ *

Example: ( {"id": 21938362, "value": ["hd_3000", "hd_5555"]})

+ */ + @JsonProperty("tagger") TAGGER("tagger"), + + /** + *

Link objects.

+ *

A field to create a relationship (see lookup relationships) to + * another object such as a user, ticket, or organization.

+ *

Example: ticket to user, ticket to ticket

+ */ + @JsonProperty("lookup") LOOKUP("lookup"); + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketFieldTypeEnum fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketFieldsResponse.java b/src/main/java/lol/pbu/z4j/model/TicketFieldsResponse.java new file mode 100644 index 0000000..07f74eb --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketFieldsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * TicketFieldsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketFieldsResponse.JSON_PROPERTY_TICKET_FIELDS) +@Serdeable +public class TicketFieldsResponse { + + public static final String JSON_PROPERTY_TICKET_FIELDS = "ticket_fields"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TICKET_FIELDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid TicketField> ticketFields; + + /** + * Add an item to the ticketFields property in a chainable fashion. + * + * @return The same instance of TicketFieldsResponse for chaining. + */ + public TicketFieldsResponse addTicketFieldsItem(TicketField ticketFieldsItem) { + if (ticketFields == null) { + ticketFields = new ArrayList<>(); + } + ticketFields.add(ticketFieldsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketPriority.java b/src/main/java/lol/pbu/z4j/model/TicketPriority.java new file mode 100644 index 0000000..af320dc --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketPriority.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The urgency with which the ticket should be addressed + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketPriority { + + @JsonProperty("urgent") + URGENT("urgent"), + + @JsonProperty("high") + HIGH("high"), + + @JsonProperty("normal") + NORMAL("normal"), + + @JsonProperty("low") + LOW("low"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketPriority fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketResponse.java b/src/main/java/lol/pbu/z4j/model/TicketResponse.java new file mode 100644 index 0000000..e00c226 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketResponse.JSON_PROPERTY_TICKET) +@Serdeable +public class TicketResponse { + + public static final String JSON_PROPERTY_TICKET = "ticket"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TICKET) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Ticket ticket; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketStatus.java b/src/main/java/lol/pbu/z4j/model/TicketStatus.java new file mode 100644 index 0000000..6ae7196 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketStatus.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The state of the ticket. If your account has activated custom ticket statuses, this is the ticket's status category. See custom ticket statuses + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketStatus { + + @JsonProperty("new") + NEW("new"), + + @JsonProperty("open") + OPEN("open"), + + @JsonProperty("pending") + PENDING("pending"), + + @JsonProperty("hold") + HOLD("hold"), + + @JsonProperty("solved") + SOLVED("solved"), + + @JsonProperty("closed") + CLOSED("closed"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketStatus fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketType.java b/src/main/java/lol/pbu/z4j/model/TicketType.java new file mode 100644 index 0000000..b9f5540 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketType.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The type of this ticket + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketType { + + @JsonProperty("problem") + PROBLEM("problem"), + + @JsonProperty("incident") + INCIDENT("incident"), + + @JsonProperty("question") + QUESTION("question"), + + @JsonProperty("task") + TASK("task"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketType fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateInput.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateInput.java new file mode 100644 index 0000000..19c2e97 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateInput.java @@ -0,0 +1,385 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * TicketUpdateInput + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketUpdateInput.JSON_PROPERTY_ADDITIONAL_COLLABORATORS, + TicketUpdateInput.JSON_PROPERTY_ASSIGNEE_EMAIL, + TicketUpdateInput.JSON_PROPERTY_ASSIGNEE_ID, + TicketUpdateInput.JSON_PROPERTY_ATTRIBUTE_VALUE_IDS, + TicketUpdateInput.JSON_PROPERTY_COLLABORATOR_IDS, + TicketUpdateInput.JSON_PROPERTY_COMMENT, + TicketUpdateInput.JSON_PROPERTY_CUSTOM_FIELDS, + TicketUpdateInput.JSON_PROPERTY_CUSTOM_STATUS_ID, + TicketUpdateInput.JSON_PROPERTY_DUE_AT, + TicketUpdateInput.JSON_PROPERTY_EMAIL_CCS, + TicketUpdateInput.JSON_PROPERTY_EXTERNAL_ID, + TicketUpdateInput.JSON_PROPERTY_FOLLOWERS, + TicketUpdateInput.JSON_PROPERTY_GROUP_ID, + TicketUpdateInput.JSON_PROPERTY_ORGANIZATION_ID, + TicketUpdateInput.JSON_PROPERTY_PRIORITY, + TicketUpdateInput.JSON_PROPERTY_PROBLEM_ID, + TicketUpdateInput.JSON_PROPERTY_REQUESTER_ID, + TicketUpdateInput.JSON_PROPERTY_SAFE_UPDATE, + TicketUpdateInput.JSON_PROPERTY_SHARING_AGREEMENT_IDS, + TicketUpdateInput.JSON_PROPERTY_STATUS, + TicketUpdateInput.JSON_PROPERTY_SUBJECT, + TicketUpdateInput.JSON_PROPERTY_TAGS, + TicketUpdateInput.JSON_PROPERTY_TYPE, + TicketUpdateInput.JSON_PROPERTY_UPDATED_STAMP, +}) +@Serdeable +public class TicketUpdateInput { + + public static final String JSON_PROPERTY_ADDITIONAL_COLLABORATORS = "additional_collaborators"; + public static final String JSON_PROPERTY_ASSIGNEE_EMAIL = "assignee_email"; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + public static final String JSON_PROPERTY_ATTRIBUTE_VALUE_IDS = "attribute_value_ids"; + public static final String JSON_PROPERTY_COLLABORATOR_IDS = "collaborator_ids"; + public static final String JSON_PROPERTY_COMMENT = "comment"; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + public static final String JSON_PROPERTY_CUSTOM_STATUS_ID = "custom_status_id"; + public static final String JSON_PROPERTY_DUE_AT = "due_at"; + public static final String JSON_PROPERTY_EMAIL_CCS = "email_ccs"; + public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id"; + public static final String JSON_PROPERTY_FOLLOWERS = "followers"; + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + public static final String JSON_PROPERTY_ORGANIZATION_ID = "organization_id"; + public static final String JSON_PROPERTY_PRIORITY = "priority"; + public static final String JSON_PROPERTY_PROBLEM_ID = "problem_id"; + public static final String JSON_PROPERTY_REQUESTER_ID = "requester_id"; + public static final String JSON_PROPERTY_SAFE_UPDATE = "safe_update"; + public static final String JSON_PROPERTY_SHARING_AGREEMENT_IDS = "sharing_agreement_ids"; + public static final String JSON_PROPERTY_STATUS = "status"; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + public static final String JSON_PROPERTY_TAGS = "tags"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_UPDATED_STAMP = "updated_stamp"; + + /** + * An array of numeric IDs, emails, or objects containing name and email properties. See Setting Collaborators. An email notification is sent to them when the ticket is updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_COLLABORATORS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Collaborator> additionalCollaborators; + + /** + * The email address of the agent to assign the ticket to + */ + @Nullable + @Email + @JsonProperty(JSON_PROPERTY_ASSIGNEE_EMAIL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String assigneeEmail; + + /** + * The agent currently assigned to the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer assigneeId; + + /** + * An array of the IDs of attribute values to be associated with the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_VALUE_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> attributeValueIds; + + /** + * The ids of users currently CC'ed on the ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_COLLABORATOR_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> collaboratorIds; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketComment comment; + + /** + * Custom fields for the ticket. See Setting custom field values + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid CustomField> customFields; + + /** + * The custom ticket status id of the ticket. See custom ticket statuses + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_STATUS_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer customStatusId; + + /** + * If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format. + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DUE_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime dueAt; + + /** + * An array of objects that represent agent or end users email CCs to add or delete from the ticket. See Setting email CCs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CCS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid EmailCC> emailCcs; + + /** + * An id you can use to link Zendesk Support tickets to local records + */ + @Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String externalId; + + /** + * An array of objects that represent agent followers to add or delete from the ticket. See Setting followers + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWERS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Follower> followers; + + /** + * The group this ticket is assigned to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer groupId; + + /** + * The organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ORGANIZATION_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer organizationId; + + @Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputPriority priority; + + /** + * For tickets of type \"incident\", the ID of the problem the incident is linked to + */ + @Nullable + @JsonProperty(JSON_PROPERTY_PROBLEM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer problemId; + + /** + * The user who requested this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Integer requesterId; + + /** + * Optional boolean. Prevents updates with outdated ticket data (`updated_stamp` property required when true) + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SAFE_UPDATE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean safeUpdate; + + /** + * An array of the numeric IDs of sharing agreements. Note that this replaces any existing agreements + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SHARING_AGREEMENT_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Integer> sharingAgreementIds; + + @Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputStatus status; + + /** + * The value of the subject field for this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String subject; + + /** + * The array of tags applied to this ticket + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> tags; + + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInputType type; + + /** + * Datetime of last update received from API. See the safe_update property + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_STAMP) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedStamp; + + /** + * Add an item to the additionalCollaborators property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addAdditionalCollaboratorsItem(Collaborator additionalCollaboratorsItem) { + if (additionalCollaborators == null) { + additionalCollaborators = new ArrayList<>(); + } + additionalCollaborators.add(additionalCollaboratorsItem); + return this; + } + + /** + * Add an item to the attributeValueIds property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addAttributeValueIdsItem(Integer attributeValueIdsItem) { + if (attributeValueIds == null) { + attributeValueIds = new ArrayList<>(); + } + attributeValueIds.add(attributeValueIdsItem); + return this; + } + + /** + * Add an item to the collaboratorIds property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addCollaboratorIdsItem(Integer collaboratorIdsItem) { + if (collaboratorIds == null) { + collaboratorIds = new ArrayList<>(); + } + collaboratorIds.add(collaboratorIdsItem); + return this; + } + + /** + * Add an item to the customFields property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addCustomFieldsItem(CustomField customFieldsItem) { + if (customFields == null) { + customFields = new ArrayList<>(); + } + customFields.add(customFieldsItem); + return this; + } + + /** + * Add an item to the emailCcs property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addEmailCcsItem(EmailCC emailCcsItem) { + if (emailCcs == null) { + emailCcs = new ArrayList<>(); + } + emailCcs.add(emailCcsItem); + return this; + } + + /** + * Add an item to the followers property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addFollowersItem(Follower followersItem) { + if (followers == null) { + followers = new ArrayList<>(); + } + followers.add(followersItem); + return this; + } + + /** + * Add an item to the sharingAgreementIds property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addSharingAgreementIdsItem(Integer sharingAgreementIdsItem) { + if (sharingAgreementIds == null) { + sharingAgreementIds = new ArrayList<>(); + } + sharingAgreementIds.add(sharingAgreementIdsItem); + return this; + } + + /** + * Add an item to the tags property in a chainable fashion. + * + * @return The same instance of TicketUpdateInput for chaining. + */ + public TicketUpdateInput addTagsItem(String tagsItem) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(tagsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateInputPriority.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputPriority.java new file mode 100644 index 0000000..a18ae9b --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputPriority.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The urgency with which the ticket should be addressed. + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketUpdateInputPriority { + + @JsonProperty("urgent") + URGENT("urgent"), + + @JsonProperty("high") + HIGH("high"), + + @JsonProperty("normal") + NORMAL("normal"), + + @JsonProperty("low") + LOW("low"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketUpdateInputPriority fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateInputStatus.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputStatus.java new file mode 100644 index 0000000..af356e0 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputStatus.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The state of the ticket. If your account has activated custom ticket statuses, this is the ticket's status category. See custom ticket statuses. + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketUpdateInputStatus { + + @JsonProperty("new") + NEW("new"), + + @JsonProperty("open") + OPEN("open"), + + @JsonProperty("pending") + PENDING("pending"), + + @JsonProperty("hold") + HOLD("hold"), + + @JsonProperty("solved") + SOLVED("solved"), + + @JsonProperty("closed") + CLOSED("closed"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketUpdateInputStatus fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateInputType.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputType.java new file mode 100644 index 0000000..577bfcc --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateInputType.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The type of this ticket. + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TicketUpdateInputType { + + @JsonProperty("problem") + PROBLEM("problem"), + + @JsonProperty("incident") + INCIDENT("incident"), + + @JsonProperty("question") + QUESTION("question"), + + @JsonProperty("task") + TASK("task"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TicketUpdateInputType fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateRequest.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateRequest.java new file mode 100644 index 0000000..a18f61a --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateRequest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketUpdateRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketUpdateRequest.JSON_PROPERTY_TICKET) +@Serdeable +public class TicketUpdateRequest { + + public static final String JSON_PROPERTY_TICKET = "ticket"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TICKET) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TicketUpdateInput ticket; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketUpdateResponse.java b/src/main/java/lol/pbu/z4j/model/TicketUpdateResponse.java new file mode 100644 index 0000000..4416ce2 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketUpdateResponse.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TicketUpdateResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketUpdateResponse.JSON_PROPERTY_AUDIT, + TicketUpdateResponse.JSON_PROPERTY_TICKET, +}) +@Serdeable +public class TicketUpdateResponse { + + public static final String JSON_PROPERTY_AUDIT = "audit"; + public static final String JSON_PROPERTY_TICKET = "ticket"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_AUDIT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Audit audit; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TICKET) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Ticket ticket; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketVia.java b/src/main/java/lol/pbu/z4j/model/TicketVia.java new file mode 100644 index 0000000..fed8688 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketVia.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.HashMap; +import java.util.Map; + +/** + * For more information, see the Via object reference + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + TicketVia.JSON_PROPERTY_CHANNEL, + TicketVia.JSON_PROPERTY_SOURCE, +}) +@Serdeable +public class TicketVia { + + public static final String JSON_PROPERTY_CHANNEL = "channel"; + public static final String JSON_PROPERTY_SOURCE = "source"; + + /** + * This tells you how the ticket or event was created. Examples: \"web\", \"mobile\", \"rule\", \"system\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String channel; + + /** + * For some channels a source object gives more information about how or why the ticket or event was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + private Map source; + + /** + * Set the value for the key for the source map property in a chainable fashion. + * + * @return The same instance of TicketVia for chaining. + */ + public TicketVia putSourceItem(String key, Object sourceItem) { + if (source == null) { + source = new HashMap<>(); + } + source.put(key, sourceItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketsCreateRequest.java b/src/main/java/lol/pbu/z4j/model/TicketsCreateRequest.java new file mode 100644 index 0000000..f0f5655 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketsCreateRequest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * TicketsCreateRequest + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketsCreateRequest.JSON_PROPERTY_TICKETS) +@Serdeable +public class TicketsCreateRequest { + + public static final String JSON_PROPERTY_TICKETS = "tickets"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TICKETS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid TicketCreateInput> tickets; + + /** + * Add an item to the tickets property in a chainable fashion. + * + * @return The same instance of TicketsCreateRequest for chaining. + */ + public TicketsCreateRequest addTicketsItem(TicketCreateInput ticketsItem) { + if (tickets == null) { + tickets = new ArrayList<>(); + } + tickets.add(ticketsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TicketsResponse.java b/src/main/java/lol/pbu/z4j/model/TicketsResponse.java new file mode 100644 index 0000000..7774341 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TicketsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * TicketsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TicketsResponse.JSON_PROPERTY_TICKETS) +@Serdeable +public class TicketsResponse { + + public static final String JSON_PROPERTY_TICKETS = "tickets"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TICKETS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Ticket> tickets; + + /** + * Add an item to the tickets property in a chainable fashion. + * + * @return The same instance of TicketsResponse for chaining. + */ + public TicketsResponse addTicketsItem(Ticket ticketsItem) { + if (tickets == null) { + tickets = new ArrayList<>(); + } + tickets.add(ticketsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Topic.java b/src/main/java/lol/pbu/z4j/model/Topic.java new file mode 100644 index 0000000..e002126 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Topic.java @@ -0,0 +1,157 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + *

The manageable_by attribute takes one of the following values:

Value Users
staff agents and managers
managers only Help Center managers

Note that manageable_by is only displayed to users who can manage the topic.

+ * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Topic.JSON_PROPERTY_NAME, + Topic.JSON_PROPERTY_CREATED_AT, + Topic.JSON_PROPERTY_DESCRIPTION, + Topic.JSON_PROPERTY_FOLLOWER_COUNT, + Topic.JSON_PROPERTY_HTML_URL, + Topic.JSON_PROPERTY_ID, + Topic.JSON_PROPERTY_MANAGEABLE_BY, + Topic.JSON_PROPERTY_POSITION, + Topic.JSON_PROPERTY_UPDATED_AT, + Topic.JSON_PROPERTY_URL, + Topic.JSON_PROPERTY_USER_SEGMENT_ID, +}) +@Serdeable +public class Topic { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + public static final String JSON_PROPERTY_FOLLOWER_COUNT = "follower_count"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_MANAGEABLE_BY = "manageable_by"; + public static final String JSON_PROPERTY_POSITION = "position"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_USER_SEGMENT_ID = "user_segment_id"; + + /** + * The name of the topic + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * When the topic was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The description of the topic. By default an empty string + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String description; + + /** + * The number of users following the topic + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWER_COUNT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long followerCount; + + /** + * The community url of the topic + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when the topic is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + @Nullable + @JsonProperty(JSON_PROPERTY_MANAGEABLE_BY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private TopicManageableBy manageableBy; + + /** + * The position of the topic relative to other topics in the community + */ + @Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long position; + + /** + * When the topic was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of the topic + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The id of the user segment to which this topic belongs + */ + @Nullable + @JsonProperty(JSON_PROPERTY_USER_SEGMENT_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long userSegmentId; + + public Topic(String name) { + this.name = name; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TopicManageableBy.java b/src/main/java/lol/pbu/z4j/model/TopicManageableBy.java new file mode 100644 index 0000000..7007c2e --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TopicManageableBy.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * The set of users who can manage this topic. + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum TopicManageableBy { + + @JsonProperty("staff") + STAFF("staff"), + + @JsonProperty("managers") + MANAGERS("managers"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static TopicManageableBy fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/TopicResponse.java b/src/main/java/lol/pbu/z4j/model/TopicResponse.java new file mode 100644 index 0000000..f99c688 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TopicResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TopicResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TopicResponse.JSON_PROPERTY_TOPIC) +@Serdeable +public class TopicResponse { + + public static final String JSON_PROPERTY_TOPIC = "topic"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TOPIC) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Topic topic; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TopicsResponse.java b/src/main/java/lol/pbu/z4j/model/TopicsResponse.java new file mode 100644 index 0000000..7a4d8aa --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TopicsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * TopicsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TopicsResponse.JSON_PROPERTY_TOPICS) +@Serdeable +public class TopicsResponse { + + public static final String JSON_PROPERTY_TOPICS = "topics"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TOPICS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Topic> topics; + + /** + * Add an item to the topics property in a chainable fashion. + * + * @return The same instance of TopicsResponse for chaining. + */ + public TopicsResponse addTopicsItem(Topic topicsItem) { + if (topics == null) { + topics = new ArrayList<>(); + } + topics.add(topicsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Translation.java b/src/main/java/lol/pbu/z4j/model/Translation.java new file mode 100644 index 0000000..e5f8daf --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Translation.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * Translation + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Translation.JSON_PROPERTY_LOCALE, + Translation.JSON_PROPERTY_TITLE, + Translation.JSON_PROPERTY_BODY, + Translation.JSON_PROPERTY_CREATED_AT, + Translation.JSON_PROPERTY_CREATED_BY_ID, + Translation.JSON_PROPERTY_DRAFT, + Translation.JSON_PROPERTY_HTML_URL, + Translation.JSON_PROPERTY_ID, + Translation.JSON_PROPERTY_OUTDATED, + Translation.JSON_PROPERTY_SOURCE_ID, + Translation.JSON_PROPERTY_SOURCE_TYPE, + Translation.JSON_PROPERTY_UPDATED_AT, + Translation.JSON_PROPERTY_UPDATED_BY_ID, + Translation.JSON_PROPERTY_URL, +}) +@Serdeable +public class Translation { + + public static final String JSON_PROPERTY_LOCALE = "locale"; + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_BODY = "body"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_CREATED_BY_ID = "created_by_id"; + public static final String JSON_PROPERTY_DRAFT = "draft"; + public static final String JSON_PROPERTY_HTML_URL = "html_url"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_OUTDATED = "outdated"; + public static final String JSON_PROPERTY_SOURCE_ID = "source_id"; + public static final String JSON_PROPERTY_SOURCE_TYPE = "source_type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_UPDATED_BY_ID = "updated_by_id"; + public static final String JSON_PROPERTY_URL = "url"; + + /** + * The locale of the translation + */ + @NotNull + @JsonProperty(JSON_PROPERTY_LOCALE) + private LocaleAbbreviation localeAbbreviation; + + /** + * The title of the translation + */ + @NotNull + @JsonProperty(JSON_PROPERTY_TITLE) + private String title; + + /** + * HTML body of the translation. Empty by default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String body; + + /** + * The time at which the translation was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The id of the user who created the translation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long createdById; + + /** + * True if the translation is a draft; false otherwise. False by default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_DRAFT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean draft; + + /** + * The url of the translation in Help Center + */ + @Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String htmlUrl; + + /** + * Automatically assigned when a translation is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * True if the translation is outdated; false otherwise. False by default + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OUTDATED) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean outdated; + + /** + * The id of the item that has this translation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long sourceId; + + /** + * The type of the item that has this translation. Can be \"article\", \"section\", or \"category\". + */ + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String sourceType; + + /** + * The time at which the translation was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The id of the user who last updated the translation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long updatedById; + + /** + * The API url of the translation + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + public Translation(LocaleAbbreviation localeAbbreviation, String title) { + this.localeAbbreviation = localeAbbreviation; + this.title = title; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/TranslationResponse.java b/src/main/java/lol/pbu/z4j/model/TranslationResponse.java new file mode 100644 index 0000000..7bd8176 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TranslationResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * TranslationResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TranslationResponse.JSON_PROPERTY_TRANSLATION) +@Serdeable +public class TranslationResponse { + + public static final String JSON_PROPERTY_TRANSLATION = "translation"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TRANSLATION) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Translation translation; + +} diff --git a/src/main/java/lol/pbu/z4j/model/TranslationsResponse.java b/src/main/java/lol/pbu/z4j/model/TranslationsResponse.java new file mode 100644 index 0000000..33484f1 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/TranslationsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * TranslationsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(TranslationsResponse.JSON_PROPERTY_TRANSLATIONS) +@Serdeable +public class TranslationsResponse { + + public static final String JSON_PROPERTY_TRANSLATIONS = "translations"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TRANSLATIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Translation> translations; + + /** + * Add an item to the translations property in a chainable fashion. + * + * @return The same instance of TranslationsResponse for chaining. + */ + public TranslationsResponse addTranslationsItem(Translation translationsItem) { + if (translations == null) { + translations = new ArrayList<>(); + } + translations.add(translationsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/UnifiedSearchResult.java b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResult.java new file mode 100644 index 0000000..8ad9ed4 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResult.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.ZonedDateTime; + +/** + * UnifiedSearchResult + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + UnifiedSearchResult.JSON_PROPERTY_TITLE, + UnifiedSearchResult.JSON_PROPERTY_TYPE, + UnifiedSearchResult.JSON_PROPERTY_UPDATED_AT, + UnifiedSearchResult.JSON_PROPERTY_URL, +}) +@Serdeable +public class UnifiedSearchResult { + + public static final String JSON_PROPERTY_TITLE = "title"; + public static final String JSON_PROPERTY_TYPE = "type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + + @Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String title; + + @Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private UnifiedSearchResultType type; + + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ZonedDateTime updatedAt; + + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + +} diff --git a/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSet.java b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSet.java new file mode 100644 index 0000000..93fe0d7 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSet.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * UnifiedSearchResultSet + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + UnifiedSearchResultSet.JSON_PROPERTY_META, + UnifiedSearchResultSet.JSON_PROPERTY_RESULTS, +}) +@Serdeable +public class UnifiedSearchResultSet { + + public static final String JSON_PROPERTY_META = "meta"; + public static final String JSON_PROPERTY_RESULTS = "results"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private UnifiedSearchResultSetMeta meta; + + @Nullable + @JsonProperty(JSON_PROPERTY_RESULTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid UnifiedSearchResult> results; + + /** + * Add an item to the results property in a chainable fashion. + * + * @return The same instance of UnifiedSearchResultSet for chaining. + */ + public UnifiedSearchResultSet addResultsItem(UnifiedSearchResult resultsItem) { + if (results == null) { + results = new ArrayList<>(); + } + results.add(resultsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSetMeta.java b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSetMeta.java new file mode 100644 index 0000000..0c2c3eb --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultSetMeta.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * UnifiedSearchResultSetMeta + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + UnifiedSearchResultSetMeta.JSON_PROPERTY_AFTER_CURSOR, + UnifiedSearchResultSetMeta.JSON_PROPERTY_BEFORE_CURSOR, + UnifiedSearchResultSetMeta.JSON_PROPERTY_HAS_MORE, +}) +@Serdeable +public class UnifiedSearchResultSetMeta { + + public static final String JSON_PROPERTY_AFTER_CURSOR = "after_cursor"; + public static final String JSON_PROPERTY_BEFORE_CURSOR = "before_cursor"; + public static final String JSON_PROPERTY_HAS_MORE = "has_more"; + + @Nullable + @JsonProperty(JSON_PROPERTY_AFTER_CURSOR) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String afterCursor; + + @Nullable + @JsonProperty(JSON_PROPERTY_BEFORE_CURSOR) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String beforeCursor; + + @Nullable + @JsonProperty(JSON_PROPERTY_HAS_MORE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean hasMore; + +} diff --git a/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultType.java b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultType.java new file mode 100644 index 0000000..d565b18 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UnifiedSearchResultType.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.micronaut.serde.annotation.Serdeable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Gets or Sets UnifiedSearchResult_type + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@RequiredArgsConstructor +@Getter(onMethod_ = {@JsonValue}) +@Serdeable +public enum UnifiedSearchResultType { + + @JsonProperty("ARTICLE") + ARTICLE("ARTICLE"), + + @JsonProperty("POST") + POST("POST"), + + @JsonProperty("EXTERNAL_RECORD") + EXTERNAL_RECORD("EXTERNAL_RECORD"), + ; + + public static final Map VALUE_MAPPING = Map.copyOf(Arrays.stream(values()) + .collect(Collectors.toMap(v -> v.value, Function.identity()))); + + private final String value; + + /** + * Create this enum from a value. + * + * @param value The value + * @return The enum + */ + @JsonCreator + public static UnifiedSearchResultType fromValue(String value) { + if (!VALUE_MAPPING.containsKey(value)) { + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + return VALUE_MAPPING.get(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/src/main/java/lol/pbu/z4j/model/UserSegment.java b/src/main/java/lol/pbu/z4j/model/UserSegment.java new file mode 100644 index 0000000..5599265 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UserSegment.java @@ -0,0 +1,228 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + *

The user_type attribute takes one of the following values:

Value Users
signed_in_users only authenticated users
staff only agents and Help Center managers

For group_ids, organization_ids, tags, and or_tags, an empty array means that access is not restricted by the attribute. For example, if no group ids are specified, then users don't have to be in any specific group to have access.

For tags, a user must have all the listed tags to have access. For or_tags, a user must have at least one of the listed tags to have access.

+ * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + UserSegment.JSON_PROPERTY_NAME, + UserSegment.JSON_PROPERTY_USER_TYPE, + UserSegment.JSON_PROPERTY_ADDED_USER_IDS, + UserSegment.JSON_PROPERTY_BUILT_IN, + UserSegment.JSON_PROPERTY_CREATED_AT, + UserSegment.JSON_PROPERTY_GROUP_IDS, + UserSegment.JSON_PROPERTY_ID, + UserSegment.JSON_PROPERTY_OR_TAGS, + UserSegment.JSON_PROPERTY_ORGANIZATION_IDS, + UserSegment.JSON_PROPERTY_TAGS, + UserSegment.JSON_PROPERTY_UPDATED_AT, +}) +@Serdeable +public class UserSegment { + + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_USER_TYPE = "user_type"; + public static final String JSON_PROPERTY_ADDED_USER_IDS = "added_user_ids"; + public static final String JSON_PROPERTY_BUILT_IN = "built_in"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_GROUP_IDS = "group_ids"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_OR_TAGS = "or_tags"; + public static final String JSON_PROPERTY_ORGANIZATION_IDS = "organization_ids"; + public static final String JSON_PROPERTY_TAGS = "tags"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + + /** + * User segment name (localized to the locale of the current user for built-in user segments) + */ + @NotNull + @JsonProperty(JSON_PROPERTY_NAME) + private String name; + + /** + * The set of users who can view content + */ + @NotNull + @JsonProperty(JSON_PROPERTY_USER_TYPE) + private String userType; + + /** + * The ids of users added specifically to this user segment, regardless of matching tags or other criteria + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ADDED_USER_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> addedUserIds; + + /** + * Whether the user segment is built-in. Built-in user segments cannot be modified + */ + @Nullable + @JsonProperty(JSON_PROPERTY_BUILT_IN) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Boolean builtIn; + + /** + * When the user segment was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * The ids of the groups that have access + */ + @Nullable + @JsonProperty(JSON_PROPERTY_GROUP_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> groupIds; + + /** + * Automatically assigned when the user segment is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * A user must have at least one tag in the list to have access + */ + @Nullable + @JsonProperty(JSON_PROPERTY_OR_TAGS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> orTags; + + /** + * The ids of the organizations that have access + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ORGANIZATION_IDS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull Long> organizationIds; + + /** + * All the tags a user must have to have access + */ + @Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@NotNull String> tags; + + /** + * When the user segment was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + public UserSegment(String name, String userType) { + this.name = name; + this.userType = userType; + } + + /** + * Add an item to the addedUserIds property in a chainable fashion. + * + * @return The same instance of UserSegment for chaining. + */ + public UserSegment addAddedUserIdsItem(Long addedUserIdsItem) { + if (addedUserIds == null) { + addedUserIds = new ArrayList<>(); + } + addedUserIds.add(addedUserIdsItem); + return this; + } + + /** + * Add an item to the groupIds property in a chainable fashion. + * + * @return The same instance of UserSegment for chaining. + */ + public UserSegment addGroupIdsItem(Long groupIdsItem) { + if (groupIds == null) { + groupIds = new ArrayList<>(); + } + groupIds.add(groupIdsItem); + return this; + } + + /** + * Add an item to the orTags property in a chainable fashion. + * + * @return The same instance of UserSegment for chaining. + */ + public UserSegment addOrTagsItem(String orTagsItem) { + if (orTags == null) { + orTags = new ArrayList<>(); + } + orTags.add(orTagsItem); + return this; + } + + /** + * Add an item to the organizationIds property in a chainable fashion. + * + * @return The same instance of UserSegment for chaining. + */ + public UserSegment addOrganizationIdsItem(Long organizationIdsItem) { + if (organizationIds == null) { + organizationIds = new ArrayList<>(); + } + organizationIds.add(organizationIdsItem); + return this; + } + + /** + * Add an item to the tags property in a chainable fashion. + * + * @return The same instance of UserSegment for chaining. + */ + public UserSegment addTagsItem(String tagsItem) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(tagsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/UserSegmentResponse.java b/src/main/java/lol/pbu/z4j/model/UserSegmentResponse.java new file mode 100644 index 0000000..6736ca0 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UserSegmentResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * UserSegmentResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(UserSegmentResponse.JSON_PROPERTY_USER_SEGMENT) +@Serdeable +public class UserSegmentResponse { + + public static final String JSON_PROPERTY_USER_SEGMENT = "user_segment"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_USER_SEGMENT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private UserSegment userSegment; + +} diff --git a/src/main/java/lol/pbu/z4j/model/UserSegmentsResponse.java b/src/main/java/lol/pbu/z4j/model/UserSegmentsResponse.java new file mode 100644 index 0000000..145a365 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UserSegmentsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * UserSegmentsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(UserSegmentsResponse.JSON_PROPERTY_USER_SEGMENTS) +@Serdeable +public class UserSegmentsResponse { + + public static final String JSON_PROPERTY_USER_SEGMENTS = "user_segments"; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_SEGMENTS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid UserSegment> userSegments; + + /** + * Add an item to the userSegments property in a chainable fashion. + * + * @return The same instance of UserSegmentsResponse for chaining. + */ + public UserSegmentsResponse addUserSegmentsItem(UserSegment userSegmentsItem) { + if (userSegments == null) { + userSegments = new ArrayList<>(); + } + userSegments.add(userSegmentsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/UserSubscription.java b/src/main/java/lol/pbu/z4j/model/UserSubscription.java new file mode 100644 index 0000000..96d53b7 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UserSubscription.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * UserSubscription + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + UserSubscription.JSON_PROPERTY_FOLLOWED_ID, + UserSubscription.JSON_PROPERTY_FOLLOWER_ID, + UserSubscription.JSON_PROPERTY_ID, +}) +@Serdeable +public class UserSubscription { + + public static final String JSON_PROPERTY_FOLLOWED_ID = "followed_id"; + public static final String JSON_PROPERTY_FOLLOWER_ID = "follower_id"; + public static final String JSON_PROPERTY_ID = "id"; + + /** + * The id of the user being followed + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWED_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long followedId; + + /** + * The id of the user doing the following + */ + @Nullable + @JsonProperty(JSON_PROPERTY_FOLLOWER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long followerId; + + /** + * Automatically assigned when the subscription is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + +} diff --git a/src/main/java/lol/pbu/z4j/model/UserSubscriptionsResponse.java b/src/main/java/lol/pbu/z4j/model/UserSubscriptionsResponse.java new file mode 100644 index 0000000..7f85b3a --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/UserSubscriptionsResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * UserSubscriptionsResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(UserSubscriptionsResponse.JSON_PROPERTY_USER_SUBSCRIPTIONS) +@Serdeable +public class UserSubscriptionsResponse { + + public static final String JSON_PROPERTY_USER_SUBSCRIPTIONS = "user_subscriptions"; + + @Nullable + @JsonProperty(JSON_PROPERTY_USER_SUBSCRIPTIONS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid UserSubscription> userSubscriptions; + + /** + * Add an item to the userSubscriptions property in a chainable fashion. + * + * @return The same instance of UserSubscriptionsResponse for chaining. + */ + public UserSubscriptionsResponse addUserSubscriptionsItem(UserSubscription userSubscriptionsItem) { + if (userSubscriptions == null) { + userSubscriptions = new ArrayList<>(); + } + userSubscriptions.add(userSubscriptionsItem); + return this; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/Via.java b/src/main/java/lol/pbu/z4j/model/Via.java new file mode 100644 index 0000000..2c9aaf4 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Via.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * An object explaining how the ticket was created. See the Via object reference + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + Via.JSON_PROPERTY_CHANNEL, + Via.JSON_PROPERTY_SOURCE, +}) +@Serdeable +public class Via { + + public static final String JSON_PROPERTY_CHANNEL = "channel"; + public static final String JSON_PROPERTY_SOURCE = "source"; + + /** + * This tells you how the ticket or event was created. Examples: \"web\", \"mobile\", \"rule\", \"system\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String channel; + + @Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ViaSource source; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ViaSource.java b/src/main/java/lol/pbu/z4j/model/ViaSource.java new file mode 100644 index 0000000..c6b3901 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ViaSource.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.*; +import lombok.experimental.Accessors; + +import java.util.HashMap; + +/** + * For some channels a source object gives more information about how or why the ticket or event was created + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ViaSource.JSON_PROPERTY_FROM, + ViaSource.JSON_PROPERTY_REL, + ViaSource.JSON_PROPERTY_TO, +}) +@Serdeable +public class ViaSource extends HashMap { + + public static final String JSON_PROPERTY_FROM = "from"; + public static final String JSON_PROPERTY_REL = "rel"; + public static final String JSON_PROPERTY_TO = "to"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ViaSourceFrom from; + + @Nullable + @JsonProperty(JSON_PROPERTY_REL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String rel; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private ViaSourceTo to; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ViaSourceFrom.java b/src/main/java/lol/pbu/z4j/model/ViaSourceFrom.java new file mode 100644 index 0000000..49523e3 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ViaSourceFrom.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ViaSourceFrom + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ViaSourceFrom.JSON_PROPERTY_ADDRESS, + ViaSourceFrom.JSON_PROPERTY_ID, + ViaSourceFrom.JSON_PROPERTY_NAME, + ViaSourceFrom.JSON_PROPERTY_TITLE, +}) +@Serdeable +public class ViaSourceFrom { + + public static final String JSON_PROPERTY_ADDRESS = "address"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_NAME = "name"; + public static final String JSON_PROPERTY_TITLE = "title"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String address; + + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + + @Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String title; + +} diff --git a/src/main/java/lol/pbu/z4j/model/ViaSourceTo.java b/src/main/java/lol/pbu/z4j/model/ViaSourceTo.java new file mode 100644 index 0000000..85fa4a8 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/ViaSourceTo.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * ViaSourceTo + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder({ + ViaSourceTo.JSON_PROPERTY_ADDRESS, + ViaSourceTo.JSON_PROPERTY_NAME, +}) +@Serdeable +public class ViaSourceTo { + + public static final String JSON_PROPERTY_ADDRESS = "address"; + public static final String JSON_PROPERTY_NAME = "name"; + + @Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String address; + + @Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String name; + +} diff --git a/src/main/java/lol/pbu/z4j/model/Vote.java b/src/main/java/lol/pbu/z4j/model/Vote.java new file mode 100644 index 0000000..4edece7 --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/Vote.java @@ -0,0 +1,130 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * Vote + * + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@EqualsAndHashCode +@ToString +@Getter +@Setter +@JsonPropertyOrder({ + Vote.JSON_PROPERTY_VALUE, + Vote.JSON_PROPERTY_CREATED_AT, + Vote.JSON_PROPERTY_ID, + Vote.JSON_PROPERTY_ITEM_ID, + Vote.JSON_PROPERTY_ITEM_TYPE, + Vote.JSON_PROPERTY_UPDATED_AT, + Vote.JSON_PROPERTY_URL, + Vote.JSON_PROPERTY_USER_ID, +}) +@Serdeable +public class Vote { + + public static final String JSON_PROPERTY_VALUE = "value"; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + public static final String JSON_PROPERTY_ID = "id"; + public static final String JSON_PROPERTY_ITEM_ID = "item_id"; + public static final String JSON_PROPERTY_ITEM_TYPE = "item_type"; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + public static final String JSON_PROPERTY_URL = "url"; + public static final String JSON_PROPERTY_USER_ID = "user_id"; + + /** + * The value of the vote + */ + @NotNull + @JsonProperty(JSON_PROPERTY_VALUE) + private Long value; + + /** + * The time at which the vote was created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String createdAt; + + /** + * Automatically assigned when the vote is created + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long id; + + /** + * The id of the item for which this vote was cast + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long itemId; + + /** + * The type of the item. Can be \"Article\", \"Comment\", \"Post\" or \"PostComment\" + */ + @Nullable + @JsonProperty(JSON_PROPERTY_ITEM_TYPE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String itemType; + + /** + * The time at which the vote was last updated + */ + @Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String updatedAt; + + /** + * The API url of this vote + */ + @Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private String url; + + /** + * The id of the user who cast this vote + */ + @Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Long userId; + + public Vote(Long value) { + this.value = value; + } + +} diff --git a/src/main/java/lol/pbu/z4j/model/VoteResponse.java b/src/main/java/lol/pbu/z4j/model/VoteResponse.java new file mode 100644 index 0000000..33cadde --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/VoteResponse.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * VoteResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(VoteResponse.JSON_PROPERTY_VOTE) +@Serdeable +public class VoteResponse { + + public static final String JSON_PROPERTY_VOTE = "vote"; + + @Nullable + @Valid + @JsonProperty(JSON_PROPERTY_VOTE) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private Vote vote; + +} diff --git a/src/main/java/lol/pbu/z4j/model/VotesResponse.java b/src/main/java/lol/pbu/z4j/model/VotesResponse.java new file mode 100644 index 0000000..d778efb --- /dev/null +++ b/src/main/java/lol/pbu/z4j/model/VotesResponse.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Peanut Butter Unicorn, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package lol.pbu.z4j.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.serde.annotation.Serdeable; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +/** + * VotesResponse + * @author Jonathan-Zollinger + * @since 0.1.1 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Data +@JsonPropertyOrder(VotesResponse.JSON_PROPERTY_VOTES) +@Serdeable +public class VotesResponse { + + public static final String JSON_PROPERTY_VOTES = "votes"; + + @Nullable + @JsonProperty(JSON_PROPERTY_VOTES) + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private List<@Valid Vote> votes; + + /** + * Add an item to the votes property in a chainable fashion. + * + * @return The same instance of VotesResponse for chaining. + */ + public VotesResponse addVotesItem(Vote votesItem) { + if (votes == null) { + votes = new ArrayList<>(); + } + votes.add(votesItem); + return this; + } + +} diff --git a/src/main/resources/Ticketing.yaml b/src/main/resources/Ticketing.yaml new file mode 100644 index 0000000..bf23939 --- /dev/null +++ b/src/main/resources/Ticketing.yaml @@ -0,0 +1,44197 @@ +# Copyright 2026 Peanut Butter Unicorn LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +openapi: 3.0.3 +info: + title: Support API + description: Zendesk Support API endpoints + version: 2.0.0 +tags: + - name: Attachments + - name: Sessions + - name: Trigger Categories + - name: Tags + - name: Targets + - name: Target Failures + - name: Job Statuses + - name: Automations + - name: Tickets + - name: Email Notifications + - name: Lookup Relationships + - name: Dynamic Content + - name: Dynamic Content Item Variants + - name: Push Notification Devices + - name: Channel Framework + - name: X Channel + - name: Organizations + - name: Triggers + - name: Object Triggers + - name: Custom Roles + - name: Incremental Export + - name: Otp + description: One Time Password + - name: Access + description: Access + - name: Internal + description: Internal APIs for Zendesk services only + - name: Account Settings + - name: Ticket Metrics + - name: Groups + - name: Group Memberships + - name: Incremental Skill Based Routing + - name: Organization Memberships + - name: Sharing Agreements + - name: Search + - name: Workspaces + - name: Security Settings + - name: Skill Based Routing + - name: Remote Authentications + - name: Resource Collections + - name: Macros + - name: Organization Subscriptions + - name: Support Addresses + - name: User Passwords + - name: User Identities + - name: Activity Stream + - name: Group SLA Policies + - name: SLA Policies + - name: Ticket Audits + - name: Ticket Metric Events + - name: Conversation Log + - name: Brands + - name: Brand Agents + - name: Users + - name: Satisfaction Reasons + - name: Ticket Content Pins + - name: Ticket Forms + - name: Ticket Form Statuses + - name: Suspended Tickets + - name: Satisfaction Ratings + - name: Ticket Comments + - name: Requests + - name: Audit Logs + - name: Views + - name: Ticket Import + - name: Organization Fields + - name: User Fields + - name: Ticket Fields + - name: Ticket Skips + - name: Bookmarks + - name: Reseller + - name: Basics + - name: AssigneeFieldAssignableGroups + - name: AssigneeFieldAssignableAgents + - name: Custom Ticket Statuses + - name: Locales + - name: Custom Objects + - name: Custom Object Permissions + - name: Custom Object Fields + - name: Custom Object Records + - name: Custom Object Record Attachments + - name: Essentials Card + - name: Omnichannel Routing Queues + - name: Deletion Schedules + - name: OAuth Clients + description: OAuth clients represent third-party applications that access the Zendesk API on behalf of users. + - name: OAuth Tokens + description: OAuth tokens are credentials used to authenticate API requests on behalf of users or applications. + - name: Grant Type Tokens + - name: Global Clients + - name: Approval Requests + - name: ITAM Assets + - name: ITAM Asset Types + - name: ITAM Asset Fields + - name: ITAM Asset Locations + - name: ITAM Asset Statuses + - name: View Categories + - name: Task List Templates + - name: Task Lists +servers: + - url: https://{subdomain}.{domain}.com + variables: + domain: + default: zendesk + subdomain: + default: example +paths: + /api/v2/{target_type}/{target_id}/relationship_fields/{field_id}/{source_type}: + get: + operationId: GetSourcesByTarget + tags: + - Lookup Relationships + summary: Get sources by target + description: | + Returns a list of source objects whose values are populated with the id of a related target object. For example, + if you have a lookup field called "Success Manager" on a ticket, this endpoint can answer the question, + "What tickets (sources) is this user (found by `target_type` and `target_id`) + assigned as the 'Success Manager' (field referenced by `field_id`)?" + + #### Allowed For + + * Agents + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: target_type + in: path + description: | + The type of object the relationship field is targeting. + The options are "zen:user", "zen:ticket", "zen:organization", and "zen:custom_object:CUSTOM_OBJECT_KEY" + required: true + schema: + type: string + example: zen:custom_object:apartment + - name: target_id + in: path + description: | + The id of the object the relationship field is targeting + required: true + schema: + type: integer + example: 1234 + - name: field_id + in: path + description: | + The id of the lookup relationship field + required: true + schema: + type: integer + example: 1234 + - name: source_type + in: path + description: | + The type of object the relationship field belongs to (example. ticket field belongs to a ticket object). + The options are "zen:user", "zen:ticket", "zen:organization", and "zen:custom_object:CUSTOM_OBJECT_KEY" + required: true + schema: + type: string + example: zen:custom_object:apartment + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ReverseLookupResponse' + examples: + default: + $ref: '#/components/examples/ReverseLookupUsersResponseExample' + /api/v2/account/settings: + get: + operationId: ShowAccountSettings + tags: + - Account Settings + summary: Show Settings + description: | + Shows the settings that are available for the account. + + #### Allowed For + + * Agents + parameters: + - name: authenticity_token + in: query + description: Legacy CSRF token. Ignored by API. + deprecated: true + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AccountSettingsResponse' + examples: + default: + $ref: '#/components/examples/AccountSettingsResponseExample' + put: + operationId: UpdateAccountSettings + tags: + - Account Settings + summary: Update Account Settings + description: | + Updates settings for the account. See [JSON Format](#json-format) above for the settings you can update. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AccountSettingsResponse' + examples: + default: + $ref: '#/components/examples/AccountSettingsResponseExample' + /api/v2/accounts: + post: + operationId: CreateTrialAccount + tags: + - Reseller + summary: Create Trial Account + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TrialAccountResponse' + examples: + default: + $ref: '#/components/examples/TrialAccountResponseExample' + /api/v2/accounts/available: + get: + operationId: VerifySubdomainAvailability + tags: + - Reseller + summary: Verify Subdomain Availability + description: | + Zendesk Support credentials are not required to access this endpoint. You can use any Zendesk Support subdomain. + + Returns "true" if the subdomain is available. + parameters: + - name: subdomain + in: query + description: | + Specify the name of the subdomain you want to verify. The name can't contain underscores, hyphens, or spaces. + required: true + schema: + type: string + example: z3ndesk + responses: + "200": + description: Success response + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: + success: true + /api/v2/activities: + get: + operationId: ListActivities + tags: + - Activity Stream + summary: List Activities + description: | + Lists ticket activities in the last 30 days affecting the agent making the request. + Also sideloads the following arrays of user records: + + - actors - All actors involved in the listed activities + - users - All users involved in the listed activities + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ActivitySince' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/PerPage' + - name: include + in: query + description: | + A comma-separated list of sideloads to include. Supported values: `fields_metadata`. + schema: + type: string + example: fields_metadata + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ActivitiesResponse' + examples: + default: + $ref: '#/components/examples/ActivitiesResponseExample' + /api/v2/activities/{activity_id}: + parameters: + - $ref: '#/components/parameters/ActivityId' + get: + operationId: ShowActivity + tags: + - Activity Stream + summary: Show Activity + description: | + Lists a specific activity. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ActivityResponse' + examples: + default: + $ref: '#/components/examples/ActivityResponseExample' + /api/v2/activities/count: + get: + operationId: CountActivities + tags: + - Activity Stream + summary: Count Activities + description: |- + Returns an approximate count of ticket activities in the last 30 days affecting the agent making the request. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of ticket activities + content: + application/json: + schema: + $ref: '#/components/schemas/ActivitiesCountResponse' + examples: + default: + $ref: '#/components/examples/ActivitiesCountResponseExample' + /api/v2/any_channel/channelback/report_error: + post: + operationId: ReportChannelbackError + tags: + - Channel Framework + summary: Report Channelback Error to Zendesk + description: | + #### Allowed For + + * Admins + + #### Request parameters + + The POST request takes a JSON object parameter which contains information about the + problematic [channelback](/documentation/channel_framework/understanding-the-channel-framework/channelback/). + + | Name | Type | Required | Comments + | ------------------ | ----------| --------- | ------------------- + | instance_push_id | string | yes | The ID of the account to which data will be pushed. This was passed to the integration service when the administrator set up the account + | external_id | string | yes | Unique identifier of the external resource from the original channelback (string) + | description | string | no | A human readable description of the error + | request_id | string | no | A unique identifier for the request + + + #### Response format + + The response does not include a response body + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/any_channel/push: + post: + operationId: PushContentToSupport + tags: + - Channel Framework + summary: Push Content to Support + description: | + Pushes Channel framework content to Zendesk. + + #### Allowed For + + * Admins + + #### Request parameters + + The POST request takes a JSON object parameter which contains data about all + the resources that the client is pushing. + + | Name | Type | Required | Comments + | ------------------ | ----------| --------- | ------------------- + | instance_push_id | string | yes | The account ID where data will be pushed. This was passed to the integration service when the administrator set up the account + | request_id | string | no | A unique identifier for the push request + | external_resources | array | yes | The [resources](#external_resource-object) to push + + #### external_resource object + + | Name | Type | Max length | Mandatory | Comments + |------------------- | ---------------------------------- |------------| --------- | ---------- + | external_id | string | 255 | yes | Unique identifier of the external resource. Must be ASCII characters + | internal_note | boolean | | no | If true creates a new internal note comment + | message | string | 65535 | yes | Text to be converted to a ticket or comment + | html_message | string | 65535 | no | HTML version of message + | parent_id | string | 511 | no | Unique identifier of the external resource for which this is a response. Used to choose the correct thread. Responses may include `parent_id` or `thread_id`, but not both. See [Conversation threads](/documentation/channel_framework/understanding-the-channel-framework/pull_endpoint/#conversation-threads) + | thread_id | string | 255 | no | Arbitrary identifier of the thread to which this item should belong. Responses may include `parent_id` or `thread_id`, but not both. See [Conversation threads](/documentation/channel_framework/understanding-the-channel-framework/pull_endpoint/#conversation-threads) + | created_at | string | | yes | When the resource was created in the origin system, as an ISO 8601 extended format date-time. Example: '2015-09-08T22:48:09Z' + | author | object | | yes | See [author object](#author-object) below + | display_info | array | | no | Array of integration-specific data used by apps to modify the agent UI. See [display_info object](#display_info-object) below + | allow_channelback | boolean | | no | If false, prevents the agent from making additional comments on the message in the Zendesk interface + | fields | array | | no | Array of ticket fields to set in Zendesk and their values. See [fields array](#fields-array) + | file_urls | array | 10 | no | Array of files to be imported into Zendesk. See [file urls](/documentation/channel_framework/understanding-the-channel-framework/pull_endpoint/#file-urls) in the Channel framework docs + + #### author object + + | Name | Type | Max chars | Mandatory | Comments + |------------ | ------ |---------- |---------- |----------- + | external_id | string | 255 | yes | Unique identifier of the user in the origin service + | name | string | 255 | no | If not supplied, defaults to external id + | image_url | string | 255 | no | URL to an image for the user + | locale | String | 255 | no | The user's locale. Must be one of the supported [locales](/api-reference/ticketing/account-configuration/locales/#list-available-public-locales) in Zendesk + | fields | array | | no | Array of items containing user field identifier ('id') and value of field ('value'.) For system fields ('notes' or 'details'), the identifier is the English name. For custom fields, the identifier may be the ID or the name + + #### display_info object + + | Name | Type | Max chars | Mandatory | Comments + |----- | ------ |---------- |---------- |----------- + | type | string | 255 | yes | Globally unique type identifier defined by the integration origin service. Examples: a GUID or URI + | data | string | 65535 | yes | JSON data containing display hints + + #### fields array + + The `fields` array lists ticket fields to set in Zendesk and their values. Each item consists of a field identifier (`id`) and a value (`value`) for the field. For Zendesk system fields such as `subject`, the identifier is the English name. For custom fields, the identifier may be a field ID or a name. See [Ticket Fields](/api-reference/ticketing/tickets/ticket_fields/). + + The `fields` array can only set ticket values on ticket creation, not on ticket updates. + + #### Response format + + The response is a JSON object containing a single key: + + | Name | Type | Comments + | --------- | -------- | ------------------- + | results | array | An array of [result objects](#result-object) + + The `results` array contains an entry for each item in the incoming `external_resources` array, in the + same order. For example, if you call `push` with 3 external resources, a successful response will include + `results` with three entries, corresponding to your 3 resources. + + #### result object + + | Name | Type | Comments + | -------------------- | ------------------------------ | ------------------- + | external_resource_id | string | The external ID of the resource, as passed in + | status | object | The status of the import for the indicated resource. See [status object](#status-object) + + #### status object + + | Name | Type | Comments + | ----------- | ------ | ------------------- + | code | string | A code indicating the status of the import of the resource, as described in [status codes](#status-codes) + | description | string | In the case of an exception, a description of the exception. Otherwise, not present. + + #### status codes + + | Key | Description + | ----------------------------------------- | ---------------- + | success | The external resource was successfully converted to a ticket or comment + | already_imported | Reimport of the external resource was skipped due to a pre-existing ticket or comment for the resource + | could_not_locate_parent_external_resource | The parent resource, as identified by parent_id in the [request](#request-parameters), could not be found. The unrecognized parent ID is returned in the description of the [status](#status-object) + | processing_error | An internal exception occurred while processing the resource. See `description` in the [status object](#status-object) + | halted | This resource was not processed because processing of previous resources failed + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ChannelFrameworkPushResultsResponse' + examples: + default: + $ref: '#/components/examples/ChannelFrameworkPushResultsResponseExample' + /api/v2/any_channel/validate_token: + post: + operationId: ValidateToken + tags: + - Channel Framework + summary: Validate Token + description: | + #### Allowed For + + * Admins + + #### Request parameters + + The POST request takes a JSON object parameter which contains the token to be validated. + + | Name | Type | Required | Comments + | ------------------ | ----------| --------- | ------------------- + | instance_push_id | string | yes | The ID of the account to which data will be pushed. This was passed to the integration service when the administrator set up the account + | request_id | string | no | A unique identifier for the push request + + #### Response format + + The response body is empty. + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/approval_requests: + get: + operationId: ListApprovalRequests + tags: + - Approval Requests + summary: List Approval Requests + description: | + Lists all approval requests for the current account with optional filtering by status and assignee. + + #### Allowed For + + * Admins + + #### Query Parameters + + | Name | Type | Description + |---------------------------|--------|-------------------------------------------------------------------------------------------- + | filter[status] | string | Filter by a comma-separated list of one or more approval statuses. Values: active, approved, rejected, withdrawn + | filter[assignee_user_id] | string | Filter by a comma-separated list of assigned user ids. Maximum 100 ids + | filter[assignee_group_id] | string | Filter by a comma-separated list of assigned group ids. Maximum 100 ids + + #### Filtering Logic + + - When multiple values are provided for a filter, `or` logic is used. For example, `filter[status]=active,approved` is evaluated as `status=active OR status=approved`. + - If multiple filters are applied to a single request, `AND` logic is used. For example, `filter[status]=active AND filter[assignee_user_id]=123`. + - Each filter parameter supports a maximum 100 values. + - Numeric ids must be valid integers. + + #### Pagination + + This endpoint supports cursor-based pagination. Use `after_cursor` and `before_cursor` parameters to navigate through results. + parameters: + - name: filter[status] + in: query + description: Filter by a comma-separated list of one or more approval statuses. Allowed values are active, approved, rejected, withdrawn. Maximum 100 values. + schema: + type: string + examples: + multiple: + summary: Multiple statuses + value: active,approved + single: + summary: Single status + value: active + - name: filter[assignee_user_id] + in: query + description: Filter by a comma-separated list of assigned user ids. Maximum 100 ids. + schema: + type: string + examples: + multiple: + summary: Multiple user ids + value: 123,456,789 + single: + summary: Single user id + value: "12345" + - name: filter[assignee_group_id] + in: query + description: Filter by a comma-separated list of assigned group ids. Maximum 100 ids. + schema: + type: string + examples: + multiple: + summary: Multiple group ids + value: 123,456,789 + single: + summary: Single group id + value: "12345" + - name: before_cursor + in: query + description: Cursor for pagination. Fetch records before this cursor + schema: + type: string + - name: after_cursor + in: query + description: Cursor for pagination. Fetch records after this cursor + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ApprovalRequestsListResponse' + examples: + default: + $ref: '#/components/examples/ApprovalRequestsListResponseExample' + post: + operationId: CreateApprovalRequest + tags: + - Approval Requests + summary: Create Approval Request + description: | + Creates an approval request for a ticket. + + When manual approval requests are turned off for the account, approval requests can still be created through this API. Approval requests created by the API have a `Sent by` value of `API`. + + #### Allowed For + + * System users (flowstate) + * Agents + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApprovalRequestCreateRequest' + examples: + assignee_group: + $ref: '#/components/examples/ApprovalRequestCreateRequestWithGroupExample' + default: + $ref: '#/components/examples/ApprovalRequestCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ApprovalRequestSimpleResponse' + examples: + default: + $ref: '#/components/examples/ApprovalRequestSimpleResponseExample' + "422": + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/ApprovalRequestErrors' + examples: + default: + $ref: '#/components/examples/ApprovalRequestErrorExample' + /api/v2/attachments/{attachment_id}: + get: + operationId: ShowAttachment + tags: + - Attachments + summary: Show Attachment + description: | + Shows attachment details. You can get the value of the `attachment_id` parameter by listing the ticket's comments. + See [List Comments](/api-reference/ticketing/tickets/ticket_comments/#list-comments). Each comment + in the list has an `attachments` list that specifies an `id` for each attachment. + + + #### Allowed for + + * Agents + parameters: + - $ref: '#/components/parameters/AttachmentId' + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + examples: + default: + $ref: '#/components/examples/AttachmentResponseExample' + put: + operationId: UpdateAttachment + tags: + - Attachments + summary: Update Attachment for Malware + description: | + Toggles enabling or restricting agent access to attachments with detected malware. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/AttachmentId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentUpdateRequest' + examples: + default: + $ref: '#/components/examples/AttachmentUpdateRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + examples: + default: + $ref: '#/components/examples/AttachmentResponseExample' + delete: + operationId: DeleteAttachment + tags: + - Attachments + summary: Delete Attachment + description: | + Deletes the attachment. + + #### Allowed for + + * Agents + parameters: + - $ref: '#/components/parameters/AttachmentId' + responses: + "204": + description: No Content response + /api/v2/audit_logs: + get: + operationId: ListAuditLogs + tags: + - Audit Logs + summary: List Audit Logs + description: | + #### Allowed For + + * Admins on accounts that have audit log access + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Filtering by multiple values + + To filter by multiple values for the same field, repeat the filter parameter and append empty square brackets "[]" to the name of each repeated parameter. For example, to return audit logs where `action` is "create", "update", or "destroy": + + `/api/v2/audit_logs?filter[action][]=create&filter[action][]=update&filter[action][]=destroy` + parameters: + - name: filter[source_type] + in: query + description: Filter audit logs by the source type. For example, user or rule + schema: + type: string + - name: filter[source_id] + in: query + description: Filter audit logs by the source id. Requires `filter[source_type]` to also be set + schema: + type: integer + - name: filter[actor_id] + in: query + description: Filter audit logs by the actor id + schema: + type: integer + - name: filter[ip_address] + in: query + description: Filter audit logs by the ip address + schema: + type: string + - name: filter[created_at] + in: query + description: Filter audit logs by the time of creation. When used, you must specify `filter[created_at]` twice in your request, first with the start time and again with an end time + schema: + type: string + - name: filter[action] + in: query + description: Filter audit logs by the action + schema: + type: string + - name: sort_by + in: query + description: Offset pagination only. Sort audit logs. Default is `sort_by=created_at` + schema: + type: string + - name: sort_order + in: query + description: Offset pagination only. Sort audit logs. Default is `sort_order=desc` + schema: + type: string + - name: sort + in: query + description: Cursor pagination only. Sort audit logs. Default is `sort=-created_at` + schema: + type: string + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AuditLogsResponse' + examples: + default: + $ref: '#/components/examples/AuditLogsResponseExample' + /api/v2/audit_logs/{audit_log_id}: + parameters: + - $ref: '#/components/parameters/AuditLogId' + get: + operationId: ShowAuditLog + tags: + - Audit Logs + summary: Show Audit Log + description: | + #### Allowed For + + * Admins on accounts that have audit-log access + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AuditLogResponse' + examples: + default: + $ref: '#/components/examples/AuditLogResponseExample' + /api/v2/audit_logs/export: + post: + operationId: ExportAuditLogs + tags: + - Audit Logs + summary: Export Audit Logs + description: | + #### Allowed For + + * Admins on accounts that have audit log access + + #### Limits + This endpoint's rate limit is different from the account-wide rate limit. The rate limit is one request per minute per account. When this limit is reached, you'll get a `429 Too Many Requests` response code. + + ##### Headers + API responses include usage limit information in the headers for this endpoint. + + ``` + Zendesk-RateLimit-audit-logs-export: total={number}; remaining={number}; resets={number} + ``` + + Within this header, “Total” signifies the initial allocation, “Remaining” indicates the remaining allowance for the current interval, and “Resets” denotes the wait time in seconds before the limit refreshes. You can see the Total, and Interval values in the below table. + + ##### Details + + The rate limit is one request per minute per account. If you exceed this, you'll receive the following error: "Rate limit for Audit log CSV Export exceeded. Please wait 1 minute and try again." + parameters: + - name: filter[source_type] + in: query + description: Filter audit logs by the source type. For example, user or rule + schema: + type: string + - name: filter[source_id] + in: query + description: Filter audit logs by the source id. Requires `filter[source_type]` to also be set. + schema: + type: integer + - name: filter[actor_id] + in: query + description: Filter audit logs by the actor id + schema: + type: integer + - name: filter[ip_address] + in: query + description: Filter audit logs by the ip address + schema: + type: string + - name: filter[created_at] + in: query + description: Filter audit logs by the time of creation. When used, you must specify `filter[created_at]` twice in your request, first with the start time and again with an end time + schema: + type: string + - name: filter[action] + in: query + description: Filter audit logs by the action + schema: + type: string + responses: + "202": + description: Accepted description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/autocomplete/tags: + parameters: + - $ref: '#/components/parameters/TagNameFragment' + get: + operationId: AutocompleteTags + tags: + - Tags + summary: Search Tags + description: | + Returns an array of registered and recent tag names that start with the characters specified in the `name` query parameter. You must specify at least 2 characters. + + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsAutocompleteResponseExample' + post: + operationId: AutocompleteTagsPost + tags: + - Tags + summary: Search Tags by Request Body + description: | + Returns an array of registered and recent tag names that start with the characters specified in the `name` parameter. You must specify at least 2 characters. + + This endpoint accepts the same parameters as the [GET method](#search-tags) but they are specified in the request body instead of the query string. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/PerPage' + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: A substring of a tag to search for + example: + name: att + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsAutocompleteResponseExample' + /api/v2/automations: + get: + operationId: ListAutomations + tags: + - Automations + summary: List Automations + description: | + Lists all automations for the current account. + + #### Allowed For + + * Agents + + #### Available Parameters + + You can pass in any combination of the following optional filters: + + | Name | Type | Comment + | ---------- | ------- | ------- + | active | boolean | Only active automations if true, inactive automations if false + | sort_by | string | Possible values are "alphabetical", "created_at", "updated_at", "usage_1h", "usage_24h", or "usage_7d". Defaults to "position" + | sort_order | string | One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + + #### Sideloads + + The following sideloads are supported. The usage sideloads are only supported on the Support Professional or Suite Growth plan or above. + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each automation, if present + | permissions | The permissions for each automation + | usage_1h | The number of tickets processed by an automation in the past hour + | usage_24h | The number of tickets processed by an automation in the past day + | usage_7d | The number of tickets processed by an automation in the past week + | usage_30d | The number of tickets processed by an automation in the past thirty days + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/AutomationActive' + - $ref: '#/components/parameters/AutomationInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationsResponse' + examples: + default: + $ref: '#/components/examples/AutomationsResponseExample' + post: + operationId: CreateAutomation + tags: + - Automations + summary: Create Automation + description: | + Creates an automation. + + New automations must be unique and have at least one condition that is true only once or an action that nullifies at least one of the conditions. Active automations can have overlapping conditions but can't be identical. + + The request must include the following conditions in the `all` array: + + - At least one time-based condition + - At least one condition that checks one of the following fields: `status`, `type`, `group_id`, `assignee_id`, or `requester_id`. + + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationResponse' + examples: + default: + $ref: '#/components/examples/AutomationCreateResponseExample' + /api/v2/automations/{automation_id}: + parameters: + - $ref: '#/components/parameters/AutomationId' + get: + operationId: ShowAutomation + tags: + - Automations + summary: Show Automation + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationResponse' + examples: + default: + $ref: '#/components/examples/AutomationResponseExample' + put: + operationId: UpdateAutomation + tags: + - Automations + summary: Update Automation + description: | + Updates an automation. + + Updated automations must be unique and have at least one condition that is true only once or an action that nullifies at least one of the conditions. Active automations can have overlapping conditions but can't be identical. + + The request must include the following conditions in the `all` array: + - At least one time-based condition + - At least one condition that checks one of the following fields: 'status', 'type', 'group_id', 'assignee_id', or 'requester_id' + + **Note**: Updating a condition or action updates both the `conditions` and `actions` arrays, clearing all existing values of both arrays. Include all your conditions and actions when updating any condition or action. + **Note**: You might be restricted from updating some default automations. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationResponse' + examples: + default: + $ref: '#/components/examples/AutomationResponseExample' + delete: + operationId: DeleteAutomation + tags: + - Automations + summary: Delete Automation + description: | + **Note**: You might be restricted from deleting some default automations. + + #### Allowed For + + * Agents + responses: + "204": + description: No Content response + /api/v2/automations/active: + get: + operationId: ListActiveAutomations + tags: + - Automations + summary: List Active Automations + description: | + Lists all active automations. + + #### Allowed For + + * Agents + + #### Available Parameters + + You can pass in any combination of the following optional filters: + + | Name | Type | Comment + | ---------- | ------ | ------- + | sort_by | string | Possible values are "alphabetical", "created_at", "updated_at", "usage_1h", "usage_24h", or "usage_7d". Defaults to "position" + | sort_order | string | One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each automation, if present + | permissions | The permissions for each automation + | usage_1h | The number of tickets processed by an automation in the past hour + | usage_24h | The number of tickets processed by an automation in the past day + | usage_7d | The number of tickets processed by an automation in the past week + | usage_30d | The number of tickets processed by an automation in the past thirty days + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationsResponse' + examples: + default: + $ref: '#/components/examples/AutomationsResponseExample' + /api/v2/automations/destroy_many: + delete: + operationId: BulkDeleteAutomations + tags: + - Automations + summary: Bulk Delete Automations + description: | + Deletes the automations corresponding to the provided comma-separated list of IDs. + + **Note**: You might be restricted from deleting some default automations. If included in a bulk deletion, the unrestricted automations will be deleted. + + #### Allowed For + + * Agents + + #### Request Parameters + + The DELETE request takes one parameter, an `ids` object that lists the automations to delete. + + | Name | Description + | ---- | ----------- + | ids | The IDs of the automations to delete + + #### Example request + + ```js + { + "ids": "25,23,27,22" + } + ``` + parameters: + - name: ids + in: query + description: The IDs of the automations to delete + schema: + type: array + items: + type: integer + responses: + "204": + description: No Content response + /api/v2/automations/search: + parameters: + - $ref: '#/components/parameters/AutomationSearchQuery' + - $ref: '#/components/parameters/AutomationActive' + - $ref: '#/components/parameters/AutomationSortBy' + - $ref: '#/components/parameters/AutomationSortOrder' + - $ref: '#/components/parameters/AutomationInclude' + get: + operationId: SearchAutomations + tags: + - Automations + summary: Search Automations + description: | + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported. For more information, see [Side-loading](/documentation/ticketing/using-the-zendesk-api/side_loading/). + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each automation, if present + | permissions | The permissions for each automation + | usage_1h | The number of tickets processed by an automation in the past hour + | usage_24h | The number of tickets processed by an automation in the past day + | usage_7d | The number of tickets processed by an automation in the past week + | usage_30d | The number of tickets processed by an automation in the past thirty days + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationsResponse' + examples: + default: + $ref: '#/components/examples/AutomationsSearchResponseExample' + /api/v2/automations/update_many: + put: + operationId: UpdateManyAutomations + tags: + - Automations + summary: Update Many Automations + description: | + **Note**: You might be restricted from updating some default automations. If included in a bulk update, the unrestricted automations will be updated. + + #### Allowed For + + * Agents + + #### Request Parameters + + The PUT request expects an `automations` object that lists the automations to update. + + Each automation may have the following properties: + + | Name | Mandatory | Description + | -------- | --------- | ----------- + | id | yes | The ID of the automation to update + | position | no | The new position of the automation + | active | no | The active status of the automation (true or false) + + #### Example Request + + ```js + { + "automations": [ + {"id": 25, "position": 3}, + {"id": 23, "position": 5}, + {"id": 27, "position": 9}, + {"id": 22, "position": 7} + ] + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationsResponse' + examples: + default: + $ref: '#/components/examples/AutomationsUpdateManyResponseExample' + /api/v2/bookmarks: + get: + operationId: ListBookmarks + tags: + - Bookmarks + summary: List Bookmarks + description: |- + Archived tickets are not included in the response. See + [About archived tickets](https://support.zendesk.com/hc/en-us/articles/4408887617050) in Zendesk help. + + #### Allowed For + - Agents + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BookmarksResponse' + examples: + default: + $ref: '#/components/examples/BookmarksResponse' + post: + operationId: CreateBookmark + tags: + - Bookmarks + summary: Create Bookmark + description: |- + #### Allowed For + - Agents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BookmarkCreateRequest' + examples: + default: + $ref: '#/components/examples/BookmarkCreateRequest' + responses: + "200": + description: Successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/BookmarkResponse' + examples: + default: + $ref: '#/components/examples/BookmarkResponse' + "201": + description: Successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/BookmarkResponse' + examples: + default: + $ref: '#/components/examples/BookmarkResponse' + /api/v2/bookmarks/{bookmark_id}: + parameters: + - $ref: '#/components/parameters/BookmarkId' + delete: + operationId: DeleteBookmark + tags: + - Bookmarks + summary: Delete Bookmark + description: |- + #### Allowed For + - Agents (own bookmarks only) + + If the bookmark already exists with a specified ticket id, the response status will be `http Status: 200 OK`. + responses: + "204": + description: No content + /api/v2/brand_agents: + get: + operationId: ListBrandAgents + tags: + - Brand Agents + summary: List Brand Agent Memberships + description: | + Returns a list of all brand agent memberships for your account. + + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Admins + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandAgentsResponse' + examples: + default: + $ref: '#/components/examples/BrandAgentsResponseExample' + /api/v2/brand_agents/{brand_agent_id}: + get: + operationId: ShowBrandAgentById + tags: + - Brand Agents + summary: Show Brand Agent Membership + description: | + Returns a brand agent membership for your account. + + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/BrandAgentId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandAgentResponse' + examples: + default: + $ref: '#/components/examples/BrandAgentResponseExample' + delete: + operationId: DeleteBrandAgentById + tags: + - Brand Agents + summary: Delete Brand Agent Membership + description: | + Deletes a brand agent membership. + + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/BrandAgentId' + responses: + "204": + description: No Content + /api/v2/brands: + get: + operationId: ListBrands + tags: + - Brands + summary: List Brands + description: |- + Returns a list of all brands for your account sorted by name. + + #### Allowed for + + * Admins + * Agents with the `assign_tickets_to_any_brand` permission can list all brands for the account + * Agents without the `assign_tickets_to_any_brand` permission can only list brands they are members of + + #### Pagination + + * Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: page + in: query + description: | + Cursor pagination parameters using deepObject format. + + Use `?page[size]=50&page[after]=cursor` to paginate through results. + style: deepObject + explode: true + schema: + oneOf: + - type: integer + description: Traditional offset pagination page number (marked internal-only because only supported for internal/bime requests, not general public API usage) + example: 1 + - type: object + description: Cursor pagination parameters (JSON:API style) + properties: + after: + type: string + description: Cursor token for next page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + before: + type: string + description: Cursor token for previous page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + size: + type: integer + description: Number of records per page + example: 50 + minimum: 1 + - name: per_page + in: query + description: | + Number of records to return per page. + + Note: Default and maximum values vary by endpoint. Check endpoint-specific + documentation for limits. + + (Marked internal-only because only used with traditional offset pagination, + which is only supported for internal/bime requests) + schema: + type: integer + minimum: 1 + example: 50 + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandsResponse' + examples: + default: + $ref: '#/components/examples/BrandsResponseExample' + post: + operationId: CreateBrand + tags: + - Brands + summary: Create Brand + description: |- + #### Allowed for + - Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BrandCreateRequest' + examples: + default: + $ref: '#/components/examples/BrandCreateRequestExample' + multipart/form-data: + schema: + type: object + properties: + brand[logo][uploaded_data]: + type: string + format: binary + description: Brand logo image file + responses: + "201": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandResponse' + examples: + default: + $ref: '#/components/examples/BrandResponseExample' + /api/v2/brands/{brand_id}: + get: + operationId: ShowBrand + tags: + - Brands + summary: Show a Brand + description: |- + Returns a brand for your account. + + #### Allowed for + + * Admins, Agents + parameters: + - $ref: '#/components/parameters/BrandId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandResponse' + examples: + default: + $ref: '#/components/examples/BrandResponseExample' + put: + operationId: UpdateBrand + tags: + - Brands + summary: Update a Brand + description: |- + Returns an updated brand. + + #### Allowed for + * Admins + + #### Updating a Brand's Image + A brand image can be updated by uploading a local file using the update brand endpoint. See the **Using curl** sections below for more information. + parameters: + - $ref: '#/components/parameters/BrandId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BrandUpdateRequest' + examples: + default: + $ref: '#/components/examples/BrandUpdateRequestExample' + multipart/form-data: + schema: + type: object + properties: + brand[logo][uploaded_data]: + type: string + format: binary + description: Brand logo image file + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandResponse' + examples: + default: + $ref: '#/components/examples/BrandResponseExample' + image/jpg: { } + image/png: { } + delete: + operationId: DeleteBrand + tags: + - Brands + summary: Delete a Brand + description: |- + Deletes a brand. + + #### Allowed for + - Admins + parameters: + - $ref: '#/components/parameters/BrandId' + responses: + "204": + description: No Content response + /api/v2/brands/{brand_id}/agents: + parameters: + - $ref: '#/components/parameters/BrandId' + get: + operationId: ListBrandAgentsByBrand + tags: + - Brand Agents + - Brands + summary: List Agents By Brand + description: | + Returns a list of all agents assigned to a specific brand. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Admins + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandAgentsResponse' + examples: + default: + $ref: '#/components/examples/BrandAgentsResponseExample' + /api/v2/brands/{brand_id}/check_host_mapping: + get: + operationId: CheckHostMappingValidityForExistingBrand + tags: + - Brands + summary: Check Host Mapping Validity for an Existing Brand + description: |- + Returns a JSON object determining whether a host mapping is valid for the given brand. + + #### Allowed for + - Admins + parameters: + - $ref: '#/components/parameters/BrandId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/HostMappingObject' + examples: + default: + $ref: '#/components/examples/HostMappingResponseValidExample' + invalidCNAMEExample: + $ref: '#/components/examples/HostMappingResponseInvalidCNAMEExample' + wrongCNAMEExample: + $ref: '#/components/examples/HostMappingResponseWrongCNAMEExample' + /api/v2/brands/check_host_mapping: + get: + operationId: CheckHostMappingValidity + tags: + - Brands + summary: Check Host Mapping Validity + description: |- + Returns a JSON object determining whether a host mapping is valid for a given subdomain. + + #### Allowed for + + * Admins + parameters: + - $ref: '#/components/parameters/HostMapping' + - $ref: '#/components/parameters/Subdomain' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/HostMappingObject' + examples: + default: + $ref: '#/components/examples/HostMappingResponseValidExample' + invalidCNAMEExample: + $ref: '#/components/examples/HostMappingResponseInvalidCNAMEExample' + wrongCNAMEExample: + $ref: '#/components/examples/HostMappingResponseWrongCNAMEExample' + /api/v2/channels/twitter/monitored_twitter_handles: + get: + operationId: ListMonitoredTwitterHandles + tags: + - X Channel + summary: List Monitored X Handles + description: | + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TwitterChannelsResponse' + examples: + default: + $ref: '#/components/examples/TwitterChannelsResponseExample' + /api/v2/channels/twitter/monitored_twitter_handles/{monitored_twitter_handle_id}: + parameters: + - $ref: '#/components/parameters/MonitoredTwitterHandleId' + get: + operationId: ShowMonitoredTwitterHandle + tags: + - X Channel + summary: Show Monitored X Handle + description: | + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TwitterChannelResponse' + examples: + default: + $ref: '#/components/examples/TwitterChannelResponseExample' + /api/v2/channels/twitter/tickets: + post: + operationId: CreateTicketFromTweet + tags: + - X Channel + summary: Create Ticket from Tweet + description: | + Turns a tweet into a ticket. You must provide the tweet id as well as the id of a monitored X (formerly Twitter) handle configured for your account. + + The submitter of the ticket is set to be the user submitting the API request. + + #### Allowed For + + * Agents + responses: + "201": + description: description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/channels/twitter/tickets/{comment_id}/statuses: + parameters: + - $ref: '#/components/parameters/CommentId' + get: + operationId: GettingTwicketStatus + tags: + - X Channel + summary: List Ticket statuses + description: | + #### Allowed For + + * Agents + parameters: + - name: ids + in: query + description: Optional comment ids to retrieve tweet information for only particular comments + schema: + type: string + example: 1,3,5 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TwitterChannelTwicketStatusResponse' + examples: + default: + $ref: '#/components/examples/TwitterChannelTwicketStatusResponseExample' + /api/v2/channels/voice/agents/{agent_id}/tickets/{ticket_id}/display: + post: + operationId: OpenTicketInAgentBrowser + tags: + - Basics + summary: Open Ticket in Agent's Browser + description: |- + Allows you to instruct an agent's browser to open a ticket. + + When the message is successfully delivered to an agent's browser: + + ```http + Status: 200 OK + ``` + + When `agent_id` or `ticket_id` is invalid: + + ```http + Status: 404 Not Found + ``` + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/AgentId' + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: string + description: empty + example: "" + example: "" + "404": + description: When the `agent_id` or `ticket_id` is invalid + content: + application/json: + schema: + type: string + description: Invalid attribute + example: "" + example: "" + /api/v2/channels/voice/agents/{agent_id}/users/{user_id}/display: + post: + operationId: OpenUsersProfileInAgentBrowser + tags: + - Basics + summary: Open a User's Profile in an Agent's Browser + description: |- + Allows you to instruct an agent's browser to open a user's profile. + + When the message is successfully delivered to an agent's browser: + + ```http + Status: 200 OK + ``` + + When `agent_id` or `user_id` is invalid: + + ```http + Status: 404 Not Found + ``` + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/AgentId' + - $ref: '#/components/parameters/UserId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: string + description: empty + example: "" + example: "" + "404": + description: When the `agent_id` or `user_id` is invalid + content: + application/json: + schema: + type: string + description: Invalid attribute + example: "" + example: "" + /api/v2/channels/voice/tickets: + post: + operationId: CreateTicketOrVoicemailTicket + tags: + - Basics + summary: Create Ticket or Voicemail Ticket + description: |- + #### Allowed For + * Agents + + ### Creating tickets + + #### Introduction + + Creating tickets using Talk Partner Edition follows the same conventions as the Create Ticket endpoint. See [Create Ticket](/api-reference/ticketing/tickets/tickets/#create-ticket). + + #### Request parameters + + The POST request takes a mandatory `ticket` object that lists the values to set when the ticket is created. + You may also include an optional `display_to_agent` value such as the ID of the agent that will see the newly created ticket. + The `display_to_agent` is validated before creating the ticket, returning a 422 error if it is invalid. + + Tickets created using this endpoint must have a `via_id` parameter. See the following + section for possible values. + + #### Zendesk Talk Integration Via IDs + + Tickets created using this endpoint must have one of the following `via_id` parameters: + + | ID | Description + | ---------| ------------- + | 44 | Voicemail + | 45 | Phone call (inbound) + | 46 | Phone call (outbound) + + ### Creating voicemail tickets + #### Request parameters + + The POST request takes a mandatory `ticket` object that lists the values to set when the ticket is created. + The ticket must have a `voice_comment` with the following values: + + | Name | Type | Comment + | ------------------ | ----------------------| ------- + | from | string | Incoming phone number + | to | string | Dialed phone number + | recording_url | string | URL of the recording + | started_at | date | [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) timestamp of the call starting time + | call_duration | integer | Duration in seconds of the call + | answered_by_id | integer | The agent who answered the call + | transcription_text | string | Transcription of the call (optional) + | location | string | Location of the caller (optional) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCreateVoicemailTicketRequest' + examples: + default: + $ref: '#/components/examples/TicketCreateTicketViaTalkRequestExample' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/TicketCreateVoicemailTicketRequest' + responses: + "201": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketResponse' + examples: + default: + $ref: '#/components/examples/TicketResponseExample' + "404": + description: When the `ticket_id` is invalid + content: + application/json: + schema: + type: string + description: Invalid attribute + example: "" + example: "" + "422": + description: When the `agent_id` is invalid + content: + application/json: + schema: + type: string + description: Invalid attribute + example: "" + example: "" + /api/v2/chat_file_redactions/{ticket_id}: + parameters: + - $ref: '#/components/parameters/TicketId' + put: + operationId: RedactChatCommentAttachment + tags: + - Ticket Comments + summary: Redact Chat Comment Attachment + description: | + Permanently removes one or more chat attachments from a chat ticket. + + **Note**: This does not work on active chats. For chat tickets that predate March 2020, consider using [Redact Ticket Comment In Agent Workspace](#redact-ticket-comment-in-agent-workspace). + + #### Allowed For + + - Agents + + [Agent Workspace](https://support.zendesk.com/hc/en-us/articles/360024218473) must enabled for the account. Deleting tickets must be enabled for agents. + + #### Request Body Properties + + | Name | Type | Required | Description | + | ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | + | chat_id | string | true | The `chat_id` in the `ChatStartedEvent` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits) | + | chat_indexes | array | false | The array of `chat_index` in the `ChatFileAttachment` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits). Mandatory if `message_ids` is not used | + | message_ids | array | false | The array of `message_id` in the `ChatFileAttachment` event in the ticket audit that is part of a `ChatStartedEvent` history. Used when redacting a ChatFileAttachment that is part of a conversation history. Mandatory if `chat_indexes` is not used | + + To get the required body properties, make a request to the [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits) endpoint. Example response: + + ```http + Status 200 OK + { + "audits": [ + "events": [ + { + "id": 1932802680168, + "type": "ChatStartedEvent", + "value": { + "visitor_id": "10502823-16EkM3T6VNq7KMd", + "chat_id": "2109.10502823.Sjuj2YrBpXwei", + "history": [ + { + "chat_index": 0, + "type": "ChatFileAttachment", + "filename": "image1.jpg" + }, + { + "chat_index": 1, + "type": "ChatFileAttachment", + "filename": "image2.jpg" + } + ] + } + } + ] + ] + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketChatCommentRedactionResponse' + examples: + default: + $ref: '#/components/examples/TicketChatCommentAttachmentRedactionResponseExample' + /api/v2/chat_redactions/{ticket_id}: + parameters: + - $ref: '#/components/parameters/TicketId' + put: + operationId: RedactChatComment + tags: + - Ticket Comments + summary: Redact Chat Comment + description: "Permanently removes words or strings from a chat ticket's comment. \n\nWrap `` tags around the content in the chat comment you want redacted. Example: \n\n```json\n{\n \"text\": \"My ID number is 847564!\"\n}\n```\n\nThe characters contained in the tag will be replaced by the ▇ symbol.\n\n**Note**: This does not work on active chats. For chat tickets that predate March 2020, consider using [Redact Ticket Comment In Agent Workspace](#redact-ticket-comment-in-agent-workspace).\n\n#### Allowed For\n\n- Agents\n\n[Agent Workspace](https://support.zendesk.com/hc/en-us/articles/360024218473) must enabled for the account. Deleting tickets must be enabled for agents.\n\n#### Request Body Properties\n\n| Name | Type | Required | Description |\n| ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| chat_id | string | true | The `chat_id` in the `ChatStartedEvent` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits) |\n| chat_index | integer | false | The `chat_index` in the `ChatMessage` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits). Mandatory if `message_id` is not used |\n| message_id | string | false | The `message_id` of the `ChatMessage` event in the ticket audit that is part of a `ChatStartedEvent` history. Used when redacting a ChatMessage that is part of a conversation history. Mandatory if `chat_index` is not used |\n| text | string | true | The `message` in the `ChatMessage` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits). Wrap `message` with `` tags |\n\nTo get the required body properties, make a request to the [Ticket Audit](/api-reference/ticketing/tickets/ticket_audits) endpoint. Example response:\n\n```http\nStatus 200 OK\n{\n \"audits\": [\n \"events\": [\n {\n \"id\": 1932802680168,\n \"type\": \"ChatStartedEvent\",\n \"value\": {\n \"visitor_id\": \"10502823-16EkM3T6VNq7KMd\",\n \"chat_id\": \"2109.10502823.Sjuj2YrBpXwei\",\n \"history\": [\n {\n \"chat_index\": 0,\n \"type\": \"ChatMessage\",\n \"message\": \"My ID number is 847564!\"\n }\n ]\n }\n }\n ]\n ]\n}\n```\n" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketChatCommentRedactionResponse' + examples: + default: + $ref: '#/components/examples/TicketChatCommentRedactionResponseExample' + /api/v2/comment_redactions/{ticket_comment_id}: + parameters: + - $ref: '#/components/parameters/TicketCommentId' + put: + operationId: RedactTicketCommentInAgentWorkspace + tags: + - Ticket Comments + summary: Redact Ticket Comment In Agent Workspace + description: "Redaction allows you to permanently remove words, strings, or attachments from a ticket comment.\n\nIn the `html_body` of the comment, wrap the content you want redacted in `` tags. Example:\n\n```json\n{\n \"html_body\": \"
My ID number is 847564!
\",\n \"ticket_id\":100\n}\n```\n\nThe characters in the redact tag will be replaced by the ▇ symbol.\n\nTo redact HTML elements such inline images, anchor tags, and links, add the `redact` tag attribute to the element as well as the `` tag to inner text, if any. Example: \n\n`some link`\n\nThe `redact` attribute only redacts the tag. Any inner text will be left behind if not enclosed in a `` tag.\n\nRedaction is permanent and can not be undone. Data is permanently deleted from Zendesk servers with no way to recover it.\n\nThis endpoint provides all the same functionality that the [Redact String in Comment](/api-reference/ticketing/tickets/ticket_comments/#redact-string-in-comment) endpoint provides, plus:\n\n- Redaction of comments in closed tickets\n\n- Redaction of comments in archived tickets\n\n- Redaction of formatted text (bold, italics, hyperlinks)\n\n**Limitations**: When content is redacted from an email comment, the content is also redacted from the original email through a background job. It may take a while for the changes to be completed.\n\n**Note**: We recommend using this endpoint instead of the [Redact String in Comment](/api-reference/ticketing/tickets/ticket_comments/#redact-string-in-comment) endpoint, which will eventually be deprecated.\n\n#### Allowed For\n\n- Agents\n\n[Agent Workspace](https://support.zendesk.com/hc/en-us/articles/360024218473) must be enabled on the account. For professional accounts, deleting tickets must be enabled for agents. On Enterprise accounts, you can assign agents to a custom role with permissions to redact ticket content.\n\n#### Request Body Properties\n\n| Name | Type | Required | Description |\n| -------------------------| ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |\n| ticket_id | integer | true | The ID of the ticket |\n| html_body | string | false | The `html_body` of the comment containing `` tags or `redact` attributes |\n| external_attachment_urls | array | false | Array of attachment URLs belonging to the comment to be redacted. See [`content_url` property of Attachment](/api-reference/ticketing/tickets/ticket-attachments/) |\n" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentResponse' + examples: + default: + $ref: '#/components/examples/TicketCommentsRedactionInAgentWorkspaceResponseExample' + /api/v2/custom_objects: + get: + operationId: ListCustomObjects + tags: + - Custom Objects + summary: List Custom Objects + description: |- + Lists all undeleted custom objects for the account + #### Allowed For + * Agents + parameters: + - name: include_ui_path + in: query + description: Include UI path in the response + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectsResponseExample' + post: + operationId: CreateCustomObject + tags: + - Custom Objects + summary: Create Custom Object + description: | + Creates an object describing all the properties required to create a custom object record + #### Allowed For + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectsCreateRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectsCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectsCreateResponseExample' + /api/v2/custom_objects/{custom_object_key}: + get: + operationId: ShowCustomObject + tags: + - Custom Objects + summary: Show Custom Object + description: | + Returns an object with the specified key + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: include_permissions_metadata + in: query + description: Include permission metadata in the response + schema: + type: boolean + - name: include_ui_path + in: query + description: Include UI path in the response + schema: + type: boolean + responses: + "200": + description: Custom Object + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectsCreateResponseExample' + patch: + operationId: UpdateCustomObject + tags: + - Custom Objects + summary: Update Custom Object + description: |- + Updates an individual custom object. The updating rules are as follows: + * Takes a `custom_object` object that specifies the properties to update + * The `key` property cannot be updated + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectsCreateResponseExample' + delete: + operationId: DeleteCustomObject + tags: + - Custom Objects + summary: Delete Custom Object + description: |- + Permanently deletes the custom object with the specified key + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/access_rules: + get: + operationId: ListAccessRules + tags: + - Custom Object Permissions + summary: List Access Rules + description: | + Returns a list of access rules for a custom object. + Access rules define conditions that restrict which custom object records a role can access. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Access Rules + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRulesResponse' + examples: + default: + $ref: '#/components/examples/AccessRulesResponseExample' + post: + operationId: CreateAccessRule + tags: + - Custom Object Permissions + summary: Create Access Rule + description: | + Creates a new access rule for a custom object. + Access rules define conditions that restrict which records a role can access based on field values or relationships. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleCreateRequest' + examples: + default: + $ref: '#/components/examples/AccessRuleCreateRequestExample' + responses: + "201": + description: Created Access Rule + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleResponse' + examples: + default: + $ref: '#/components/examples/AccessRuleResponseExample' + /api/v2/custom_objects/{custom_object_key}/access_rules/{id}: + get: + operationId: ShowAccessRule + tags: + - Custom Object Permissions + summary: Show Access Rule + description: "Returns a specific access rule for a custom object.\n#### Allowed For\n* Admins \n" + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: id + in: path + description: The access rule ID + required: true + schema: + type: string + example: "6862342718335" + responses: + "200": + description: Access Rule + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleResponse' + examples: + default: + $ref: '#/components/examples/AccessRuleResponseExample' + patch: + operationId: UpdateAccessRule + tags: + - Custom Object Permissions + summary: Update Access Rule + description: | + Updates an existing access rule for a custom object. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: id + in: path + description: The access rule ID + required: true + schema: + type: string + example: "6862342718335" + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleUpdateRequest' + examples: + default: + $ref: '#/components/examples/AccessRuleUpdateRequestExample' + responses: + "200": + description: Updated Access Rule + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleResponse' + examples: + default: + $ref: '#/components/examples/AccessRuleResponseExample' + delete: + operationId: DeleteAccessRule + tags: + - Custom Object Permissions + summary: Delete Access Rule + description: | + Permanently deletes an access rule for a custom object. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: id + in: path + description: The access rule ID + required: true + schema: + type: string + example: "6862342718335" + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/access_rules/definitions: + get: + operationId: ListAccessRuleDefinitions + tags: + - Custom Object Permissions + summary: List Access Rule Definitions + description: | + Returns the available field definitions and operators that can be used when creating access rules for a custom object. + This endpoint helps you understand what fields are available for filtering and what operators can be applied to each field type. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Access Rule Definitions + content: + application/json: + schema: + $ref: '#/components/schemas/AccessRuleDefinitionsResponse' + examples: + default: + $ref: '#/components/examples/AccessRuleDefinitionsResponseExample' + /api/v2/custom_objects/{custom_object_key}/fields: + get: + operationId: ListCustomObjectFields + tags: + - Custom Object Fields + summary: List Custom Object Fields + description: |- + Lists all undeleted custom fields for the specified object. + + #### Allowed For + * Agents + + #### Pagination + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/IncludeStandardFields' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectFieldsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldsResponseExample' + post: + operationId: CreateCustomObjectField + tags: + - Custom Object Fields + summary: Create Custom Object Field + description: | + Creates any of the following custom field types: + + * text (default when no "type" is specified) + * textarea + * checkbox + * date + * integer + * decimal + * regexp + * dropdown + * lookup + * multiselect + + See [About custom field types](https://support.zendesk.com/hc/en-us/articles/203661866) in Zendesk help. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectFieldsCreateRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldsCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectFieldResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldCreateResponseExample' + /api/v2/custom_objects/{custom_object_key}/fields/{custom_object_field_key_or_id}: + get: + operationId: ShowCustomObjectField + tags: + - Custom Object Fields + summary: Show Custom Object Field + description: | + Returns a custom field for a specific object using a provided key or id of the field. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectFieldKeyOrId' + - name: include_standard_fields + in: query + description: If true, returns standard fields in addition to custom fields. + schema: + type: boolean + responses: + "200": + description: Custom Object Field + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectFieldResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldCreateResponseExample' + patch: + operationId: UpdateCustomObjectField + tags: + - Custom Object Fields + summary: Update Custom Object Field + description: |- + Updates individual custom object fields. The updating rules are as follows: + * Takes a `custom_object_field` object that specifies the properties to update. + * The `key` property cannot be updated. + * If updating a standard field, only the `title`, `description`, and `properties` attributes can be updated. + * Standard name field is always required. Therefore, the `required` property for standard name field isn't editable. + * The `properties` parameter is comprised of four parts and can't be changed if any records exist for the object. + * `autoincrement_enabled`: A Boolean that enables and disables autonumbering. Must be false if is_unique is true. + * `autoincrement_prefix`: A string value that is used as a prefix to the autogenerated numbers. It can't exceed 30 characters. + * `autoincrement_padding`: An integer specifying the starting number of digits in the autogenerated numbers. This value may be between 0-9. However, if you create records in excess of of these digits, additional digits are added as necessary. + * `autoincrement_next_sequence`: An integer that will be used as the next number in the autonumbering sequence. It can't be negative or less than the current autonumbering value. + * `is_unique`: A Boolean that enforces uniqueness for manually entered record names. When true, custom object record names must be unique. Must be false if autoincrement_enabled is true. + + #### Updating drop-down field options + + You can also use the update endpoint to add, update, or remove options in a drop-down custom field. Updating field options for multi-select fields works exactly the same as drop-down field options. + + **Important**: Unless you want to remove some options, you must specify all existing options in any update request. Omitting an option removes it from the drop-down field, which removes its values from any tickets or macros. + + Use the `custom_field_options` attribute to update the options. The attribute consists of an array of option objects, with each object consisting of an `id`, `name`, and `value` property. The name and value properties correspond to the "Title" and "Tag" text boxes in the admin interface respectively. For new drop-down options, specify `"id":"null"`. Example request body: + + ```json + {"custom_object_field": { + "custom_field_options": [ + {"id": "null", "name": "Apple Pie", "value": "apple"}, + {"id": "null", "name": "Pecan Pie", "value": "pecan"} + ] + } + } + ``` + + #### Example Request + + ```bash + curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/fields/{custom_object_field_key_or_id} + -d '{"ticket_field": {"custom_field_options": [{"name": "Apple Pie", "value": "apple"}, {"name": "Pecan Pie", "value": "pecan"}]}}' \ + -H "Content-Type: application/json" -X PUT \ + -v -u {email_address}/token:{api_token} + ``` + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectFieldKeyOrId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectFieldResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldCreateResponseExample' + delete: + operationId: DeleteCustomObjectField + tags: + - Custom Object Fields + summary: Delete Custom Object Field + description: |- + Deletes a field with the specified key. Note: You can't delete standard fields. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectFieldKeyOrId' + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/fields/reorder: + put: + operationId: ReorderCustomObjectFields + tags: + - Custom Object Fields + summary: Reorder Custom Fields of an Object + description: | + Sets a preferred order of custom fields for a specific object by providing field ids in the desired order. + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Reordered + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/custom_objects/{custom_object_key}/jobs: + post: + operationId: CustomObjectRecordBulkJobs + tags: + - Custom Object Records + summary: Custom Object Record Bulk Jobs + description: | + Queues a background job to perform bulk actions on up to 100 custom object records per single request. + Takes a `job` object with two nested fields: + * `action`, one of: + * `"create"` + * `"delete"` + * `"delete_by_external_id"` + * `"create_or_update_by_external_id"` + * `"create_or_update_by_name"` + * `"update"` + * `items` + * For a `"create"` action, an array of JSON objects representing the custom object records being created + * For a `"delete"` action, an array of strings representing Zendesk record ids + * For a `"delete_by_external_id"` action, an array of strings representing external ids + * For a `"create_or_update_by_external_id"` action, an array of JSON objects representing the custom object records being created or updated by external id + * For a `"create_or_update_by_name"` action, an array of JSON objects representing the custom object records being created or updated by name. The `is_unique` property on the custom object's name field must be enabled. + * For an `"update"` action, an array of JSON objects representing the custom object records being updated + + Note: If autonumbering is selected for the custom object's name field, record names aren't allowed in the request body because they are generated automatically. If uniqueness is enabled, the record names must be unique. + + #### Allowed For + * Agents + + #### Response ### + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsBulkCreateRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsBulkCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsJobsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsJobsResponseExample' + /api/v2/custom_objects/{custom_object_key}/limits/field_limit: + get: + operationId: CustomObjectFieldsLimit + tags: + - Custom Object Fields + summary: Custom Object Fields Limit + description: |- + List the current count and the limit for a custom object's fields + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectLimitsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectFieldsLimitResponseExample' + /api/v2/custom_objects/{custom_object_key}/permission_policies: + get: + operationId: ListPermissionPolicies + tags: + - Custom Object Permissions + summary: List Permission Policies + description: | + Returns a list of permission policies for a custom object. + Permission policies define what actions (create, read, update, delete) different roles can perform on custom object records. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Permission Policies + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionPoliciesResponse' + examples: + default: + $ref: '#/components/examples/PermissionPoliciesResponseExample' + /api/v2/custom_objects/{custom_object_key}/permission_policies/{id}: + get: + operationId: ShowPermissionPolicy + tags: + - Custom Object Permissions + summary: Show Permission Policy + description: | + Returns a permission policy for a specific role on a custom object. + The policy ID can be: + - `custom-role-{custom_role_id}` for custom roles + - `end-user` for the end user system role + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: id + in: path + description: | + The permission policy ID. Use `custom-role-{custom_role_id}` for custom roles or `end-user` for the end user system role. + required: true + schema: + type: string + example: custom-role-6678128886399 + responses: + "200": + description: Permission Policy + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionPolicyResponse' + examples: + default: + $ref: '#/components/examples/PermissionPolicyResponseExample' + patch: + operationId: UpdatePermissionPolicy + tags: + - Custom Object Permissions + summary: Update Permission Policy + description: | + Updates a permission policy for a specific role on a custom object. + Define what actions (create, read, update, delete) the role can perform and optionally specify access rules. + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: id + in: path + description: | + The permission policy ID. Use `custom-role-{custom_role_id}` for custom roles or `end-user` for the end user system role. + required: true + schema: + type: string + example: custom-role-6678128886399 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionPolicyUpdateRequest' + examples: + default: + $ref: '#/components/examples/PermissionPolicyUpdateRequestExample' + responses: + "200": + description: Updated Permission Policy + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionPolicyResponse' + examples: + default: + $ref: '#/components/examples/PermissionPolicyResponseExample' + /api/v2/custom_objects/{custom_object_key}/records: + get: + operationId: ListCustomObjectRecords + tags: + - Custom Object Records + summary: List Custom Object Records + description: |- + Lists all undeleted custom object records for the specified object + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: filter[ids] + in: query + description: Optional comma-separated list of ids to filter records by. If one or more ids are specified, only matching records are returned. The ids must be unique and are case sensitive. + schema: + type: string + examples: + multipleIds: + summary: Example of multiple ids + value: id_1,id_2,id_3 + oneId: + summary: Example of a single id + value: id_1 + - name: filter[external_ids] + in: query + description: Optional comma-separated list of external ids to filter records by. If one or more ids are specified, only matching records are returned. The ids must be unique and are case sensitive. + schema: + type: string + examples: + multipleIds: + summary: Example of multiple ids + value: ex_id_1,ex_id_2,ex_id_3 + oneId: + summary: Example of a single id + value: ex_id_1 + - name: sort + in: query + description: | + One of `id`, `updated_at`, `-id`, or `-updated_at`. The `-` denotes the sort will be descending. + schema: + type: string + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[size] + in: query + description: | + Specifies how many records should be returned in the response. You can specify up to 100 records per page. + schema: + type: integer + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsIndexResponseExample' + post: + operationId: CreateCustomObjectRecord + tags: + - Custom Object Records + summary: Create Custom Object Record + description: | + Creates a custom object record according to all the properties described by a custom object definition. If `autoincrement_enabled` is true, record names aren't allowed in the request body because they are generated automatically. If `is_unique` is true, record names must be unique. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsCreateRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsCreateResponseExample' + patch: + operationId: UpsertCustomObjectRecordByExternalIdOrName + tags: + - Custom Object Records + summary: Create or Update Custom Object Record + description: | + Creates or updates a custom object record based on the provided external id or name. If a record exists for the given external id or name, updates it. Only the specified attributes are updated. Otherwise, creates a new record with the provided external id, name and other attributes. The `is_unique` property on the custom object's name field must be enabled in order to update or create by name. External id and name cannot be used together in the same request. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordExternalId' + - $ref: '#/components/parameters/CustomObjectRecordName' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsUpsertRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsUpsertRequestExample' + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsUpsertResponseExample' + delete: + operationId: DeleteCustomObjectRecordByExternalIdOrName + tags: + - Custom Object Records + summary: Delete Custom Object Record by External Id Or Name + description: | + Deletes a record with the specified external id or name. The `is_unique` property on the custom object's name field must be enabled in order to delete by name. External id and name cannot be used together in the same request. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordExternalId' + - $ref: '#/components/parameters/CustomObjectRecordName' + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}: + get: + operationId: ShowCustomObjectRecord + tags: + - Custom Object Records + summary: Show Custom Object Record + description: | + Returns a custom record for a specific object using a provided id. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordId' + responses: + "200": + description: Custom Object Record + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsCreateResponseExample' + patch: + operationId: UpdateCustomObjectRecord + tags: + - Custom Object Records + summary: Update Custom Object Record + description: |- + Updates an individual custom object record. The updating rules are as follows: + * Takes a `custom_object_record` object that specifies the properties to update + * The custom object fields should be nested inside a `custom_object_fields` object + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsCreateResponseExample' + delete: + operationId: DeleteCustomObjectRecord + tags: + - Custom Object Records + summary: Delete Custom Object Record + description: |- + Deletes a record with the specified id + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordId' + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/records/{record_id}/attachments: + get: + operationId: ListCustomObjectRecordAttachments + tags: + - Custom Object Record Attachments + summary: List Custom Object Record Attachments + description: |- + Lists all attachments associated with a custom object record. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordIdParam' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordAttachmentsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordAttachmentsIndexResponseExample' + "400": + description: Bad Request - Attachments not allowed for custom object + content: + application/json: + schema: + type: object + properties: + error: + type: string + examples: + default: + $ref: '#/components/examples/ErrorBadRequestExample' + post: + operationId: CreateCustomObjectRecordAttachment + tags: + - Custom Object Record Attachments + summary: Create Custom Object Record Attachment + description: | + Creates a new attachment associated with a custom object record. The custom object must have the "allows_attachments" setting enabled. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordIdParam' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + uploaded_data: + type: string + format: binary + description: The file to upload as an attachment + required: + - uploaded_data + examples: + default: + $ref: '#/components/examples/CustomObjectRecordAttachmentCreateRequestExample' + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordAttachmentResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordAttachmentCreateResponseExample' + "400": + description: Bad Request - Attachments not allowed for custom object or invalid request + content: + application/json: + schema: + type: object + properties: + error: + type: string + examples: + default: + $ref: '#/components/examples/ErrorBadRequestExample' + /api/v2/custom_objects/{custom_object_key}/records/{record_id}/attachments/{id}: + put: + operationId: UpdateCustomObjectRecordAttachment + tags: + - Custom Object Record Attachments + summary: Update Custom Object Record Attachment for Malware + description: | + Updates malware access settings for the specified attachment. This is typically used to allow access to attachments that were flagged as containing malware. + + #### Allowed For + * Admins + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordIdParam' + - $ref: '#/components/parameters/CustomObjectRecordAttachmentId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordAttachmentUpdateRequest' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordAttachmentUpdateRequestExample' + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordAttachmentResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordAttachmentUpdateResponseExample' + "400": + description: Bad Request - Attachments not allowed for custom object + content: + application/json: + schema: + type: object + properties: + error: + type: string + examples: + default: + $ref: '#/components/examples/ErrorBadRequestExample' + delete: + operationId: DeleteCustomObjectRecordAttachment + tags: + - Custom Object Record Attachments + summary: Delete Custom Object Record Attachment + description: | + Deletes the specified attachment associated with a custom object record. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordIdParam' + - $ref: '#/components/parameters/CustomObjectRecordAttachmentId' + responses: + "204": + description: No Content - attachment successfully deleted + "400": + description: Bad Request - Attachments not allowed for custom object + content: + application/json: + schema: + type: object + properties: + error: + type: string + examples: + default: + $ref: '#/components/examples/ErrorBadRequestExample' + /api/v2/custom_objects/{custom_object_key}/records/{record_id}/attachments/{id}/download: + get: + operationId: DownloadCustomObjectRecordAttachment + tags: + - Custom Object Record Attachments + summary: Download Custom Object Record Attachment + description: | + Downloads the specified attachment content. Returns a redirect to the attachment's content URL. + Access to malicious attachments is controlled by the `malware_access_override` setting. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/CustomObjectRecordIdParam' + - $ref: '#/components/parameters/CustomObjectRecordAttachmentId' + - name: inline + in: query + description: | + If true, the attachment content is displayed inline in the browser. If false or omitted, the attachment is downloaded as a file. + schema: + type: boolean + default: false + examples: + download: + summary: Download attachment as file + value: false + inline: + summary: Display attachment inline + value: true + responses: + "200": + description: Successful download of attachment content + content: + application/octet-stream: + schema: + type: string + format: binary + "400": + description: Bad Request - Attachments not allowed for custom object + content: + application/json: + schema: + type: object + properties: + error: + type: string + examples: + default: + $ref: '#/components/examples/ErrorBadRequestExample' + /api/v2/custom_objects/{custom_object_key}/records/autocomplete: + get: + operationId: AutocompleteCustomObjectRecordSearch + tags: + - Custom Object Records + summary: Autocomplete Custom Object Record Search + description: |- + Retrieves an array of custom object records that have a field value that matches the value specified in the `name` parameter. + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + * Returns the first 10,000 records sorted by relevancy with page limits. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: name + in: query + description: Part of a name of the record you are searching for + schema: + type: string + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[size] + in: query + description: | + The number of records to return in the response. You can specify up to 100 records per page. + schema: + type: integer + - name: field_id + in: query + description: | + The id of the lookup field. If the field has a relationship filter, the filter is applied to the results. Must be used with `source` param. + schema: + type: string + - name: source + in: query + description: | + One of "zen:user", "zen:ticket", "zen:organization", or "zen:custom_object:CUSTOM_OBJECT_KEY". Represents the object `field_id` belongs to. Must be used with field_id param. + schema: + type: string + - name: filter[dynamic_values] + in: query + description: | + Provided values to be used with [dynamic filters](/api-reference/ticketing/lookup_relationships/lookup_relationships/#using-dynamic-filters). + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: integer + example: + ticket_brand_id: 456 + ticket_fields_123: 123 + - name: requester_id + in: query + description: | + The id of the requester. For use with dynamic filters. + schema: + type: integer + example: 264817272 + - name: assignee_id + in: query + description: | + The id of the selected assignee. For use with dynamic filters. + schema: + type: integer + example: 7334148660734 + - name: organization_id + in: query + description: | + The id of the organization the requester belongs to. For use with dynamic filters. + schema: + type: integer + example: 5633330889598 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsAutocompleteResponseExample' + /api/v2/custom_objects/{custom_object_key}/records/count: + get: + operationId: CountCustomObjectRecords + tags: + - Custom Object Records + summary: Count Custom Object Records + description: |- + Returns a total count of records for a specific custom object as well as the time the count was refreshed. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + responses: + "200": + description: Success response + content: + application/json: + schema: + type: object + properties: + count: + type: object + additionalProperties: + properties: + refreshed_at: + description: The time the last count was performed + format: date-time + readOnly: true + type: string + value: + description: Number of records at the time of the latest count operation + readOnly: true + type: integer + examples: + default: + value: + count: + refreshed_at: "2022-09-02T22:44:35Z" + value: 7 + /api/v2/custom_objects/{custom_object_key}/records/search: + get: + operationId: SearchCustomObjectRecords + tags: + - Custom Object Records + summary: Search Custom Object Records + description: |- + Returns an array of custom object records where the search query matches the values in Text Fields, Multi Line Text fields, and RegExp fields. To find records in other fields, use the [Filtered Search API](/api-reference/custom-data/custom-objects/custom_object_records/#filtered-search-of-custom-object-records) endpoint. + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + * Returns the records sorted by relevancy with page limits. Without a `sort` parameter, only the first 10,000 records are returned. With a `sort` parameter, all records are returned. + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: query + in: query + description: | + The query parameter is used to search text-based fields for records that match specific query terms. + The query can be multiple words or numbers. Every record that matches the beginning of any word or number in the query string is returned.

+ + Fuzzy search is supported for the following text-based field types: Text fields, Multi Line Text fields, and RegExp fields.

+ + For example, you might want to search for records related to Tesla vehicles: `query=Tesla`. In this example the API would return every record for the given custom object where any of the supported text fields contain the word 'Tesla'.

+ + You can include multiple words or numbers in your search. For example: `query=Tesla Honda 2020`. This search phrase would be URL encoded as `query=Tesla%20Honda%202020` and return every record for the custom object for which any of the supported text fields contained 'Tesla', 'Honda', or '2020'. + schema: + type: string + example: jdoe + - name: sort + in: query + description: | + One of `name`, `created_at`, `updated_at`, `-name`, `-created_at`, or `-updated_at`. The `-` denotes the sort will be descending. Defaults to sorting by relevance. + schema: + type: string + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[size] + in: query + description: | + Specifies how many records should be returned in the response. You can specify up to 100 records per page. + schema: + type: integer + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsSearchResponseExample' + post: + operationId: FilteredSearchCustomObjectRecords + tags: + - Custom Object Records + summary: Filtered Search of Custom Object Records + description: |- + Returns an array of custom object records that meet the search and filter criteria. For simple searches limited to only text fields and no complex logic, use the [Search Custom Object Records API](/api-reference/custom-data/custom-objects/custom_object_records/#search-custom-object-records) endpoint. + + Filters can contain either an individual [comparison object](#comparison-object) or an array of [comparison objects](#comparison-object) within logical namespaces. + + A filter is a JSON object that has the following properties: + + | Name | Type | Required | Description + | --------- | ------ | -------- | ----------- + | ATTRIBUTE | object | no | A [comparison object](#comparison-object) specifying an attribute value condition to be met for records to match.

Examples are marked below. + | $and | array | no | Array of conjunctive filter objects (logical AND) + | $or | array | no | Array of conjunctive filter objects (logical OR) + + ##### Examples + + ```js + { + "filter": { + "custom_object_fields.field_key": { "$eq": "value" } // ATTRIBUTE + } + } + ``` + + ```js + // $or + { + "filter": { + "$or": [ + { "custom_object_fields.field_key": { "$eq": "value" } }, // ATTRIBUTE + { "external_id": { "$eq": "Record123" } } // ATTRIBUTE + ] + } + } + ``` + + #### Comparison Object + + A comparison object defines a condition a record must meet to be considered a match. The condition is based on an attribute value or object type. + + A comparison object is a JSON object that has the following properties: + + | Name | Type | Required | Description + | --------- | ------------- | -------- | ----------- + | FIELD_KEY | string | yes | When filtering on a custom field, they must be namedspaced with `custom_object_fields.`. ex. `custom_object_fields.field_key`

When filtering on a standard field, no namespace is required. The following fields are considered standard: `created_at`, `updated_at`, `created_by_user`, `updated_by_user`, `name`, `external_id` + | OPERATOR | string | yes | [Supported operators](/documentation/custom-data/v2/searching-custom-object-records/) vary by the value's data type + | VALUE | string, array | yes | The value you're filtering for + + * Date values should be in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + * Returns the records sorted by relevancy with page limits. Without a `sort` parameter, only the first 10,000 records are returned. With a `sort` parameter, all records are returned. + + #### Allowed For + + * Agents + * End users (when an admin [configures](https://support.zendesk.com/hc/en-us/articles/6034260247066) the custom object to be accessible to end users) + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - name: query + in: query + description: | + The query parameter is used to search text-based fields for records that match specific query terms. + The query can be multiple words or numbers. Every record that matches the beginning of any word or number in the query string is returned.

+ + Fuzzy search is supported for the following text-based field types: Text fields, Multi Line Text fields, and RegExp fields.

+ + For example, you might want to search for records related to Tesla vehicles: `query=Tesla`. In this example the API would return every record for the given custom object where any of the supported text fields contain the word 'Tesla'.

+ + You can include multiple words or numbers in your search. For example: `query=Tesla Honda 2020`. This search phrase would be URL encoded as `query=Tesla%20Honda%202020` and return every record for the custom object for which any of the supported text fields contained 'Tesla', 'Honda', or '2020'. + schema: + type: string + example: jdoe + - name: sort + in: query + description: | + One of "name", "created_at", "updated_at", "-name", "-created_at", or "-updated_at". The "-" denotes the sort will be descending. Defaults to sorting by relevance. + schema: + type: string + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[size] + in: query + description: | + Specifies how many records should be returned in the response. You can specify up to 100 records per page. + schema: + type: integer + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CustomObjectRecordsFilteredSearchRequestBasic' + - $ref: '#/components/schemas/CustomObjectRecordsFilteredSearchRequestComplex' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsFilteredSearchRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRecordsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsSearchResponseExample' + /api/v2/custom_objects/{custom_object_key}/triggers: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + get: + operationId: ListObjectTriggers + tags: + - Object Triggers + summary: List Object Triggers + description: "Lists all triggers for the specified custom object.\n\n#### Allowed For \n* Agents\n" + parameters: + - $ref: '#/components/parameters/TriggerActive' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggersResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggersResponseExample' + post: + operationId: CreateObjectTrigger + tags: + - Object Triggers + summary: Create Object Trigger + description: | + Creates a new object trigger for a specified object. + + #### Allowed For + + * Administrators + * Agents in custom roles with the `manage_triggers` permission (Enterprise only) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerRequest' + examples: + default: + $ref: '#/components/examples/ObjectTriggerRequestExample' + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggerResponseExample' + /api/v2/custom_objects/{custom_object_key}/triggers/{trigger_id}: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/TriggerId' + get: + operationId: GetObjectTrigger + tags: + - Object Triggers + summary: Show Object Trigger + description: | + Returns details of a specific object trigger. + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggerResponseExample' + put: + operationId: UpdateObjectTrigger + tags: + - Object Triggers + summary: Update Object Trigger + description: | + Updates a specified object trigger. + + **Note**: Updating a condition or action updates both the conditions and actions arrays, + clearing all existing values of both arrays. Include all your conditions + and actions when updating any condition or action. + + #### Allowed For + + * Administrators + * Agents in custom roles with the `manage_triggers` permission (Enterprise only) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerRequest' + examples: + default: + $ref: '#/components/examples/ObjectTriggerRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggerResponseExample' + delete: + operationId: DeleteObjectTrigger + tags: + - Object Triggers + summary: Delete Object Trigger + description: | + Deletes a specified object trigger. + + #### Allowed For + + * Administrators + * Agents in custom roles with the `manage_triggers` permission (Enterprise only) + responses: + "204": + description: No Content response + /api/v2/custom_objects/{custom_object_key}/triggers/active: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + get: + operationId: ListActiveObjectTriggers + tags: + - Object Triggers + summary: List Active Object Triggers + description: | + Lists all active object triggers. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Administrators + * Agents in custom roles with the `manage_triggers` permission (Enterprise only) + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggersResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggersActiveResponseExample' + /api/v2/custom_objects/{custom_object_key}/triggers/definitions: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + get: + operationId: ListObjectTriggersDefinitions + tags: + - Object Triggers + summary: List Object Trigger Action and Condition Definitions + description: "Lists the conditions and actions of all triggers for the specified custom object.\n\n#### Allowed For \n* Agents\n" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerDefinitionResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggerDefinitionResponseExample' + /api/v2/custom_objects/{custom_object_key}/triggers/destroy_many: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/TriggerIds' + delete: + operationId: DeleteManyObjectTriggers + tags: + - Object Triggers + summary: Delete Many Object Triggers + description: "Deletes the object triggers corresponding to the provided comma-separated list of ids. \n\n**Note**: You can only bulk-delete triggers associated with one object at a time, specified by the `custom_object_key` in the request.\n\n#### Allowed For\n\n* Administrators\n* Agents in custom roles with the `manage_triggers` permission (Enterprise only)\n\n#### Request Parameters\n\nThe DELETE request takes an `ids` object that lists the\nobject triggers to delete. All of the specified object trigger `ids` must be associated with a single object.\n\n| Name | Description\n| ---- | -----------\n| ids | The ids of the triggers to delete\n\n#### Example request\n\n```js\n{\n \"ids\": \"25,23,27,22\"\n}\n```\n" + responses: + "204": + description: No content response + /api/v2/custom_objects/{custom_object_key}/triggers/search: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + - $ref: '#/components/parameters/TriggerSearchQuery' + - $ref: '#/components/parameters/TriggerSearchFilter' + - $ref: '#/components/parameters/TriggerActive' + - $ref: '#/components/parameters/TriggerSort' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + - $ref: '#/components/parameters/TriggerInclude' + get: + operationId: SearchObjectTriggers + tags: + - Object Triggers + summary: Search Object Triggers + description: | + Returns a list of object triggers that meet your filter or search criteria. + + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + + #### Filter + + Use the `filter` query parameter to filter an object trigger search by one or more attributes. For example, the following `filter` argument filters object triggers by the `title` attribute: + + ```json + { + "json": { + "title": "test" + } + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggersResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggersSearchResponseExample' + /api/v2/custom_objects/{custom_object_key}/triggers/update_many: + parameters: + - $ref: '#/components/parameters/CustomObjectKey' + put: + operationId: UpdateManyObjectTriggers + tags: + - Object Triggers + summary: Update Many Object Triggers + description: | + Updates the position or the active status of multiple object triggers. Any additional properties are ignored. + + **Note**: You can only bulk-update triggers associated with one object at a time, specified by the `custom_object_key` in the request. + + #### Allowed For + + * Administrators + * Agents in custom roles with the `manage_triggers` permission (Enterprise only) + + #### Request Parameters + + The PUT request expects a `triggers` object that lists the object triggers to update. All of the specified object trigger `ids` must be associated with a single object. + + You can specify the following properties for each object trigger you're updating: + + | Name | Mandatory | Description + | -------- | --------- | ----------- + | id | yes | The ID of the object trigger to update + | position | no | The new position of the object trigger + | active | no | The active status of the object trigger (true or false) + + #### Example Request + + ```js + { + "triggers": [ + {"id": 25, "position": 3}, + {"id": 23, "active": true}, + {"id": 27, "position": 9, "active": false}, + {"id": 22, "position": 7} + ] + } + ``` + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggerBulkUpdateRequest' + examples: + default: + $ref: '#/components/examples/ObjectTriggerBulkUpdateRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTriggersResponse' + examples: + default: + $ref: '#/components/examples/ObjectTriggersResponseExample' + /api/v2/custom_objects/limits/object_limit: + get: + operationId: CustomObjectsLimit + tags: + - Custom Objects + summary: Custom Objects Limit + description: |- + List the current count and the limit for custom objects + #### Allowed For + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectLimitsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectsLimitResponseExample' + /api/v2/custom_objects/limits/record_limit: + get: + operationId: CustomObjectRecordsLimit + tags: + - Custom Object Records + summary: Custom Object Records Limit + description: |- + List the current count and the limit for custom object records + #### Allowed For + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectLimitsResponse' + examples: + default: + $ref: '#/components/examples/CustomObjectRecordsLimitResponseExample' + /api/v2/custom_roles: + get: + operationId: ListCustomRoles + tags: + - Custom Roles + summary: List Custom Roles + description: | + #### Availability + + * Accounts on the Enterprise plan or above + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRolesResponse' + examples: + default: + $ref: '#/components/examples/CustomRolesResponseExample' + post: + operationId: CreateCustomRole + tags: + - Custom Roles + summary: Create Custom Role + description: | + #### Availability + + * Accounts on the Enterprise plan or above + + #### Allowed for + + * Administrators + * Agents with the `manage_roles` permission + responses: + "200": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRoleResponse' + examples: + default: + $ref: '#/components/examples/CustomRoleResponseExample' + /api/v2/custom_roles/{custom_role_id}: + parameters: + - $ref: '#/components/parameters/CustomRoleId' + get: + operationId: ShowCustomRoleById + tags: + - Custom Roles + summary: Show Custom Role + description: | + #### Availability + + * Accounts on the Enterprise plan or above + + #### Allowed for + + * Administrators + * Agents with the `manage_roles` permission + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRoleResponse' + examples: + default: + $ref: '#/components/examples/CustomRoleResponseExample' + put: + operationId: UpdateCustomRoleById + tags: + - Custom Roles + summary: Update Custom Role + description: | + #### Availability + + * Accounts on the Enterprise plan or above + + #### Allowed for + + * Administrators + Agents with the `manage_roles` permission + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRoleResponse' + examples: + default: + $ref: '#/components/examples/CustomRoleResponseExample' + delete: + operationId: DeleteCustomRoleById + tags: + - Custom Roles + summary: Delete Custom Role + description: | + #### Availability + + * Accounts on the Enterprise plan or above + + #### Allowed for + + * Administrators + * Agents with the `manage_roles` permission + responses: + "204": + description: No Contetnt response + /api/v2/custom_status/default: + put: + operationId: BulkUpdateDefaultCustomStatus + tags: + - Custom Ticket Statuses + summary: Bulk Update Default Custom Ticket Status + description: | + Updates the default values for many custom ticket statuses at once. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateDefaultCustomStatusRequest' + examples: + default: + $ref: '#/components/examples/BulkUpdateDefaultCustomStatusRequestExample' + responses: + "200": + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateDefaultCustomStatusResponse' + examples: + default: + $ref: '#/components/examples/BulkUpdateDefaultCustomStatusResponseExample' + /api/v2/custom_statuses: + get: + operationId: ListCustomStatuses + tags: + - Custom Ticket Statuses + summary: List Custom Ticket Statuses + description: | + Lists all undeleted custom ticket statuses for the account. No pagination is provided. + + #### Allowed For + + * End Users + parameters: + - name: status_categories + in: query + description: Filter the list of custom ticket statuses by a comma-separated list of status categories + schema: + type: string + - name: active + in: query + description: If true, show only active custom ticket statuses. If false, show only inactive custom ticket statuses. If the filter is not used, show all custom ticket statuses + schema: + type: boolean + - name: default + in: query + description: If true, show only default custom ticket statuses. If false, show only non-default custom ticket statuses. If the filter is not used, show all custom ticket statuses + schema: + type: boolean + responses: + "200": + description: List custom ticket statuses + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusesResponse' + examples: + default: + $ref: '#/components/examples/CustomStatusesResponseExample' + post: + operationId: CreateCustomStatus + tags: + - Custom Ticket Statuses + summary: Create Custom Ticket Status + description: | + Takes a `custom_status` object that specifies the custom ticket status properties to create. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusCreateRequest' + examples: + default: + $ref: '#/components/examples/CustomStatusCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusResponse' + examples: + default: + $ref: '#/components/examples/CustomStatusResponseExample' + /api/v2/custom_statuses/{custom_status_id}: + get: + operationId: ShowCustomStatus + tags: + - Custom Ticket Statuses + summary: Show Custom Ticket Status + description: | + Returns the custom ticket status object. + + #### Allowed For + + * End Users + parameters: + - $ref: '#/components/parameters/CustomStatusId' + responses: + "200": + description: Custom Status + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusResponse' + examples: + default: + $ref: '#/components/examples/CustomStatusResponseExample' + put: + operationId: UpdateCustomStatus + tags: + - Custom Ticket Statuses + summary: Update Custom Ticket Status + description: | + Takes a `custom_status` object that specifies the properties to update. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CustomStatusId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusUpdateRequest' + examples: + default: + $ref: '#/components/examples/CustomStatusUpdateRequestExample' + responses: + "200": + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/CustomStatusResponse' + examples: + default: + $ref: '#/components/examples/CustomStatusResponseExample' + delete: + operationId: DeleteCustomStatus + tags: + - Custom Ticket Statuses + summary: Delete Custom Ticket Status + description: | + Deletes the custom ticket status. The status must first be unassigned + from all active (non-closed) tickets before it can be deleted. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CustomStatusId' + responses: + "204": + description: No Content + /api/v2/custom_statuses/{custom_status_id}/ticket_form_statuses: + parameters: + - $ref: '#/components/parameters/CustomStatusId' + post: + operationId: CreateTicketFormStatusesForCustomStatus + tags: + - Custom Ticket Statuses + - Ticket Form Statuses + summary: Create Ticket Form Statuses for a Custom Status + description: | + Creates one or many tickets form status associations for a custom status. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + type: object + properties: + ticket_form_status: + type: array + items: + type: object + properties: + ticket_form_id: + type: integer + description: The id of the ticket form + example: 1 + example: + ticket_form_status: + - ticket_form_id: 1 + - ticket_form_id: 2 + - ticket_form_id: 3 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + /api/v2/deleted_tickets: + get: + operationId: ListDeletedTickets + tags: + - Tickets + summary: List Deleted Tickets + description: |- + Returns a maximum of 100 deleted tickets per page. See [Pagination](/api-reference/introduction/pagination/). + + The results includes all deleted (and not yet archived) tickets that + have not yet been [scrubbed](https://support.zendesk.com/hc/en-us/articles/4408845703194#topic_fv5_w51_sdb) in the past 30 days. Archived tickets are + not included in the results. See [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756) + in the Support Help Center. + + The tickets are ordered chronologically by created date, from oldest to newest. + The first ticket listed may not be the oldest ticket in your + account due to [ticket archiving](https://support.zendesk.com/hc/en-us/articles/203657756). + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + + #### Rate Limit + + You can make 10 requests every 1 minute using this endpoint. + When making requests beyond page 100, you can make 5 requests every 1 minute. These rate limits apply to both API calls and actions performed in the Admin Center. + The rate limiting mechanism behaves as described in + [Monitoring your request activity](/api-reference/ticketing/account-configuration/usage_limits/#monitoring-your-request-activity) in the API introduction. + parameters: + - $ref: '#/components/parameters/TicketSortBy' + - $ref: '#/components/parameters/TicketSortOrder' + - $ref: '#/components/parameters/TicketSupportTypeScope' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListDeletedTicketsResponse' + examples: + default: + $ref: '#/components/examples/ListDeletedTicketsResponseExample' + /api/v2/deleted_tickets/{ticket_id}: + delete: + operationId: DeleteTicketPermanently + tags: + - Tickets + summary: Delete Ticket Permanently + description: |- + Permanently deletes a soft-deleted ticket. See [Soft delete](https://support.zendesk.com/hc/en-us/articles/4408834005530#topic_zrm_wbj_1db) + in the Zendesk GDPR docs. To soft delete a ticket, use the [Delete Ticket](#delete-ticket) endpoint. + + This endpoint enqueues a ticket deletion job and returns a payload with the jobs status. + + If the job succeeds, the ticket is permanently deleted. This operation can't be undone. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. + Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/PermanentlyDeleteTicketJobStatusResponseExample' + /api/v2/deleted_tickets/{ticket_id}/restore: + put: + operationId: RestoreDeletedTicket + tags: + - Tickets + summary: Restore a Previously Deleted Ticket + description: |- + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Empty response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/deleted_tickets/destroy_many: + delete: + operationId: BulkPermanentlyDeleteTickets + tags: + - Tickets + summary: Delete Multiple Tickets Permanently + description: |- + Permanently deletes up to 100 soft-deleted tickets. See [Soft delete](https://support.zendesk.com/hc/en-us/articles/4408834005530#topic_zrm_wbj_1db) + in the Zendesk GDPR docs. To soft delete tickets, use the [Bulk Delete Tickets](#bulk-delete-tickets) endpoint. + + This endpoint accepts a comma-separated list of up to 100 ticket ids. It enqueues + a ticket deletion job and returns a payload with the jobs status. + + If one ticket fails to be deleted, the endpoint still attempts to delete the others. If the job succeeds, + the tickets that were successfully deleted are permanently deleted. This operation can't be undone. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketIds' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/PermanentlyDeleteTicketJobStatusResponseExample' + /api/v2/deleted_tickets/restore_many: + put: + operationId: BulkRestoreDeletedTickets + tags: + - Tickets + summary: Restore Previously Deleted Tickets in Bulk + description: |- + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketIds' + responses: + "200": + description: Empty response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/deleted_users: + get: + operationId: ListDeletedUsers + tags: + - Users + summary: List Deleted Users + description: | + Returns deleted users, including permanently deleted users. + + If the results contains permanently deleted users, the users' properties + that normally contain personal data, such as `email` and `phone`, + are null. The `name` property is "Permanently Deleted User". + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedUsersResponse' + examples: + default: + $ref: '#/components/examples/DeletedUsersResponseExample' + /api/v2/deleted_users/{deleted_user_id}: + parameters: + - $ref: '#/components/parameters/DeletedUserId' + get: + operationId: ShowDeletedUser + tags: + - Users + summary: Show Deleted User + description: | + Returns users that have been deleted but not permanently yet. See [Permanently Delete User](#permanently-delete-user). + + #### Allowed For: + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedUserResponse' + examples: + default: + $ref: '#/components/examples/DeletedUserResponseExample' + delete: + operationId: PermanentlyDeleteUser + tags: + - Users + summary: Permanently Delete User + description: | + Before permanently deleting a user, you must delete the user first. See [Delete User](/api-reference/ticketing/users/users/#delete-user). + + WARNING: Permanently deleting a user deletes all of their information. This information is not recoverable. + + #### Permanent user deletion rate limit + + You can permanently delete 700 users every 10 minutes. + The rate limiting mechanism behaves as described in + [Rates Limits](/api-reference/introduction/rate-limits/#monitoring-your-request-activity) in the API introduction. + Zendesk recommends that you obey the Retry-After header values. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage end users or team members + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedUserResponse' + examples: + default: + $ref: '#/components/examples/DeletedUserResponseExample' + /api/v2/deleted_users/count: + get: + operationId: CountDeletedUsers + tags: + - Users + summary: Count Deleted Users + description: | + Returns an approximate count of deleted users, including permanently deleted users. If the count exceeds 100,000, it is updated every 24 hours. + + The response includes a `refreshed_at` property in a `count` object that contains a timestamp indicating when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountResponse' + examples: + default: + $ref: '#/components/examples/DeletedUsersCountResponseExample' + /api/v2/deletion_schedules: + get: + operationId: ListDeletionSchedules + tags: + - Deletion Schedules + summary: List Deletion Schedules + description: | + Lists all deletion schedules for the account. Deletion schedules are used to automatically delete data from the account after a certain period of time. + + #### Allowed For + + * Admins + responses: + "200": + description: Success Response + content: + application/json: + schema: + type: object + properties: + deletion_schedules: + type: array + items: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/GetDeletionSchedulesResponseExample' + post: + operationId: CreateDeletionSchedule + tags: + - Deletion Schedules + summary: Create Deletion Schedule + description: | + Creates a new deletion schedule. + + #### Allowed For + + * Admins + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + deletion_schedule: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/CreateDeletionScheduleRequestExample' + responses: + "201": + description: Success Response + content: + application/json: + schema: + type: object + properties: + deletion_schedule: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/CreateDeletionScheduleResponseExample' + /api/v2/deletion_schedules/{deletion_schedule_id}: + get: + operationId: GetDeletionSchedule + tags: + - Deletion Schedules + summary: Get Deletion Schedule + description: | + Gets a deletion schedule by its id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/DeletionScheduleId' + responses: + "200": + description: Success Response + content: + application/json: + schema: + type: object + properties: + deletion_schedule: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/GetDeletionScheduleResponseExample' + put: + operationId: UpdateDeletionSchedule + tags: + - Deletion Schedules + summary: Update Deletion Schedule + description: | + Updates a deletion schedule by its id. + + **Note**: Updating a condition updates the conditions array, clearing all existing values of the array. Include all your conditions when updating any condition. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/DeletionScheduleId' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + deletion_schedule: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/UpdateDeletionScheduleRequestExample' + responses: + "200": + description: Success Response + content: + application/json: + schema: + type: object + properties: + deletion_schedule: + $ref: '#/components/schemas/DeletionSchedule' + examples: + default: + $ref: '#/components/examples/UpdateDeletionScheduleResponseExample' + delete: + operationId: DeleteDeletionSchedule + tags: + - Deletion Schedules + summary: Delete Deletion Schedule + description: | + Deletes a deletion schedule by its id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/DeletionScheduleId' + responses: + "204": + description: Success Response + /api/v2/dynamic_content/items: + get: + operationId: ListDynamicContents + tags: + - Dynamic Content + summary: List Items + description: | + Returns a list of all dynamic content items for your account if accessed as an admin or agents who have permission to manage dynamic content. + + #### Allowed For + + * Admins, Agents + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentsResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentsResponseExample' + post: + operationId: CreateDynamicContent + tags: + - Dynamic Content + summary: Create Item + description: | + Create a new content item, with one or more variants in the item's `variants` array. See [Specifying item variants](#specifying-item-variants). + + The `default_locale_id` and variant `locale_id` values must be one of the locales the account has active. You can get the list with the [List Locales](/api-reference/ticketing/account-configuration/locales/#list-locales) endpoint. + + #### Allowed For + + * Admins, Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentResponseExample' + /api/v2/dynamic_content/items/{dynamic_content_item_id}: + parameters: + - $ref: '#/components/parameters/DynamicContentItemId' + get: + operationId: ShowDynamicContentItem + tags: + - Dynamic Content + summary: Show Item + description: | + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentResponseExample' + put: + operationId: UpdateDynamicContentItem + tags: + - Dynamic Content + summary: Update Item + description: | + The only attribute you can change is the name. + + To add a variant to the item, or to update or delete the variants of the item, use the [Item Variants API](/api-reference/ticketing/ticket-management/dynamic_content_item_variants/#update-many-variants). + + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentUpdateResponseExample' + delete: + operationId: DeleteDynamicContentItem + tags: + - Dynamic Content + summary: Delete Item + description: | + #### Allowed For + + * Admins, Agents + responses: + "204": + description: No Content response + /api/v2/dynamic_content/items/{dynamic_content_item_id}/variants: + parameters: + - $ref: '#/components/parameters/DynamicContentItemId' + get: + operationId: DynamicContentListVariants + tags: + - Dynamic Content Item Variants + summary: List Variants + description: | + Returns all the variants of the specified dynamic content item. + + #### Allowed For + + * Admins + * Agents who have permission to manage dynamic content + + #### Pagination + + * Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantsResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantsResponseExample' + post: + operationId: CreateDynamicContentVariant + tags: + - Dynamic Content Item Variants + summary: Create Variant + description: | + You can only create one variant for each locale id. If a locale variant already exists, the request is rejected. + + #### Allowed For + + * Admins, Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantResponseExample' + /api/v2/dynamic_content/items/{dynamic_content_item_id}/variants/{dynamic_content_variant_id}: + parameters: + - $ref: '#/components/parameters/DynamicContentItemId' + - $ref: '#/components/parameters/DynamicContentVariantId' + get: + operationId: ShowDynamicContentVariant + tags: + - Dynamic Content Item Variants + summary: Show Variant + description: | + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantResponseExample' + put: + operationId: UpdateDynamicContentVariant + tags: + - Dynamic Content Item Variants + summary: Update Variant + description: | + Updates the specified variant. You don't need to include all the properties. If you just want to update content, for example, then include just that. + + You can't switch the active state of the default variant of an item. Similarly, you can't switch the default to false if the variant is the default. You must make another variant default instead. + + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantUpdateResponseExample' + delete: + operationId: DeleteDynamicContentVariant + tags: + - Dynamic Content Item Variants + summary: Delete Variant + description: | + #### Allowed For + + * Admins, Agents + responses: + "204": + description: No Content response + /api/v2/dynamic_content/items/{dynamic_content_item_id}/variants/create_many: + parameters: + - $ref: '#/components/parameters/DynamicContentItemId' + post: + operationId: CreateManyDynamicContentVariants + tags: + - Dynamic Content Item Variants + summary: Create Many Variants + description: | + #### Allowed For + + * Admins, Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantsResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantsCreateManyResponseExample' + /api/v2/dynamic_content/items/{dynamic_content_item_id}/variants/update_many: + parameters: + - $ref: '#/components/parameters/DynamicContentItemId' + put: + operationId: UpdateManyDynamicContentVariants + tags: + - Dynamic Content Item Variants + summary: Update Many Variants + description: | + Updates one or more variants. See [Update Variant](/api-reference/ticketing/ticket-management/dynamic_content_item_variants/#update-variant). + + You must specify the variants by id in the body. To get the variant ids, see [List Variants](/api-reference/ticketing/ticket-management/dynamic_content_item_variants/#list-variants). + + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentVariantsResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentVariantsUpdateManyResponseExample' + /api/v2/dynamic_content/items/show_many: + get: + operationId: ShowManyDynamicContents + tags: + - Dynamic Content + summary: Show Many Items + description: | + #### Stability + + * Development + + #### Allowed For + + * Admins, Agents + parameters: + - name: identifiers + in: query + description: Identifiers for the dynamic contents + schema: + type: string + example: item1,item2 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicContentsResponse' + examples: + default: + $ref: '#/components/examples/DynamicContentsResponseExample' + /api/v2/email_notifications: + parameters: + - $ref: '#/components/parameters/EmailNotificationsFilter' + - $ref: '#/components/parameters/IncrementalPage' + - $ref: '#/components/parameters/Sort' + get: + operationId: ListEmailNotifications + tags: + - Email Notifications + summary: List Email Notifications + description: | + #### Allowed For + + * Agents + + #### Request parameters + + ##### Filters + + **Important**: You must specify a `filter` query parameter to narrow the scope of the search for this endpoint. + + * By notification: `api/v2/email_notifications?filter[notification_id]=7824075373693` + * By comment: `api/v2/email_notifications?filter[comment_id]=782407` + * By ticket: `api/v2/email_notifications?filter[ticket_id]=623` + + ##### Pagination + + By default, a maximum of 100 email notifications are included per page. Use cursor-based pagination parameters (`page[after]` and `page[before]`) to navigate the records (can't be used together in the same request). See [Pagination](/api-reference/introduction/pagination/) for more details. + + ##### Sorting + + By default, email notifications are sorted by creation time (newest first). The query parameter is not supported for this endpoint. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationsResponse' + examples: + default: + $ref: '#/components/examples/EmailNotificationsResponseExample' + /api/v2/email_notifications/{notification_id}: + parameters: + - $ref: '#/components/parameters/NotificationId' + get: + operationId: ShowEmailNotification + tags: + - Email Notifications + summary: Show Email Notification + description: | + Shows details on an email notification. You can get the value of the `notification_id` parameter by listing the ticket's outbound emails. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationResponse' + examples: + default: + $ref: '#/components/examples/EmailNotificationResponseExample' + /api/v2/email_notifications/show_many: + parameters: + - $ref: '#/components/parameters/NotificationIds' + - $ref: '#/components/parameters/CommentIds' + - $ref: '#/components/parameters/EmailNotificationsByTicketIds' + get: + operationId: ShowManyEmailNotifications + tags: + - Email Notifications + summary: Show Many Email Notifications + description: | + Shows details of many email notifications. Allows you to query by providing a list of notifications, comments, or tickets IDs. + + #### Allowed For + + * Agents + + #### Filters + + * By notification: `?ids=8433702508541,8433348111869` + * By comment: `?comment_ids=8433348111741,8433544226045,8433702508413` + * By ticket: `?ticket_ids=730,723` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationResponse' + examples: + default: + $ref: '#/components/examples/EmailNotificationResponseExample' + /api/v2/end_users/{user_id}/identities: + parameters: + - $ref: '#/components/parameters/UserId' + - name: type[] + in: query + description: Filters results by one or more identity types using the format `?type[]={type}&type[]={type}` + explode: true + schema: + type: string + enum: + - email + - phone_number + get: + operationId: ListEndUserIdentities + tags: + - User Identities + summary: List End User Identities + description: | + Returns a list of identities for the given end user. + + End users can only list email and phone number identities. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page for cursor pagination. + + #### Allowed For + + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentitiesResponse' + examples: + default: + $ref: '#/components/examples/UserIdentitiesResponseExample' + post: + operationId: CreateEndUserIdentity + tags: + - User Identities + summary: Create End User Identity + description: | + Adds an identity to an end user's profile. + + Supported identity types for end users: + + | Type | Example | + | ---------------- | ------- | + | email | `{ "type" : "email", "value" : "someone@example.com" }` | + | phone_number | `{ "type" : "phone_number", "value" : "+1 555-123-4567" }` | + + #### Allowed For + + * Verified end users + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityCreateResponseExample' + /api/v2/end_users/{user_id}/identities/{user_identity_id}: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + get: + operationId: ShowEndUserIdentity + tags: + - User Identities + summary: Show End User Identity + description: | + Shows the identity with the given id for a given end user. + + End users can only view email or phone number identity. + + #### Allowed For + + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityResponseExample' + delete: + operationId: DeleteEndUserIdentity + tags: + - User Identities + summary: Delete End User Identity + description: | + Deletes the identity for a given end user. + + In certain cases, a phone number associated with an identity is still visible on the user profile after the identity has been deleted via API. + + #### Allowed For + + * Verified end users + responses: + "204": + description: No Content response + /api/v2/end_users/{user_id}/identities/{user_identity_id}/make_primary: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + put: + operationId: MakeEndUserIdentityPrimary + tags: + - User Identities + summary: Make End User Identity Primary + description: | + Sets the specified identity as primary for the end user. This is a collection-level operation and the correct behavior for an API client is to subsequently reload the entire collection. + + An end user can only make an email identity primary if the email is verified. + + #### Allowed For + + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentitiesResponse' + examples: + default: + $ref: '#/components/examples/UserIdentitiesResponseExample' + /api/v2/end_users/{user_id}/identities/{user_identity_id}/request_verification: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + put: + operationId: RequestEndUserVerification + tags: + - User Identities + summary: Request End User Verification + description: | + Sends the end user a verification email with a link to verify ownership of the email address. + + #### Allowed For + + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/group_memberships: + get: + operationId: ListGroupMemberships + tags: + - Group Memberships + summary: List Memberships + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/GroupMembershipsInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + post: + operationId: CreateGroupMembership + tags: + - Group Memberships + summary: Create Membership + description: | + Assigns an agent to a given group. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipResponseExample' + /api/v2/group_memberships/{group_membership_id}: + parameters: + - $ref: '#/components/parameters/GroupMembershipId' + get: + operationId: ShowGroupMembershipById + tags: + - Group Memberships + summary: Show Membership + description: | + The 'id' is the group membership id, not a group id. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipResponseExample' + delete: + operationId: DeleteGroupMembership + tags: + - Group Memberships + summary: Delete Membership + description: | + Immediately removes a user from a group and schedules a job to unassign all working tickets that are assigned to the given user and group combination. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + responses: + "204": + description: No content response + /api/v2/group_memberships/assignable: + get: + operationId: ListAssignableGroupMemberships + tags: + - Group Memberships + summary: List Assignable Memberships + description: | + Returns a maximum of 100 group memberships per page. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + /api/v2/group_memberships/create_many: + post: + operationId: GroupMembershipBulkCreate + tags: + - Group Memberships + summary: Bulk Create Memberships + description: | + Assigns up to 100 agents to given groups. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/group_memberships/destroy_many: + delete: + operationId: GroupMembershipBulkDelete + tags: + - Group Memberships + summary: Bulk Delete Memberships + description: | + Immediately removes users from groups and schedules a job to unassign all working tickets that are assigned to the given user and group combinations. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + parameters: + - name: ids + in: query + description: Id of the group memberships to delete. Comma separated + schema: + type: string + example: 1,2,3 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusBulkDeleteResponseExample' + /api/v2/group_slas/policies: + get: + operationId: ListGroupSLAPolicies + tags: + - Group SLA Policies + summary: List Group SLA Policies + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupSLAPoliciesResponse' + examples: + default: + $ref: '#/components/examples/GroupSLAPoliciesResponseExample' + post: + operationId: CreateGroupSLAPolicy + tags: + - Group SLA Policies + summary: Create Group SLA Policy + description: | + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupSLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/GroupSLAPolicyCreateResponse' + /api/v2/group_slas/policies/{group_sla_policy_id}: + parameters: + - $ref: '#/components/parameters/GroupSLAPolicyId' + get: + operationId: ShowGroupSLAPolicy + tags: + - Group SLA Policies + summary: Show Group SLA Policy + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupSLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/GroupSLAPolicyResponseExample' + put: + operationId: UpdateGroupSLAPolicy + tags: + - Group SLA Policies + summary: Update Group SLA Policy + description: | + Updates the specified policy. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupSLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/GroupSLAPolicyUpdateResponse' + delete: + operationId: DeleteGroupSLAPolicy + tags: + - Group SLA Policies + summary: Delete Group SLA Policy + description: | + #### Allowed For + + * Admins + responses: + "204": + description: No Content response + /api/v2/group_slas/policies/definitions: + get: + operationId: RetrieveGroupSLAPolicyFilterDefinitionItems + tags: + - Group SLA Policies + summary: Retrieve Supported Filter Definition Items + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupSLAPolicyFilterDefinitionResponse' + examples: + default: + $ref: '#/components/examples/GroupSLAPolicyFilterDefinitionResponseExample' + /api/v2/group_slas/policies/reorder: + put: + operationId: ReorderGroupSLAPolicies + tags: + - Group SLA Policies + summary: Reorder Group SLA Policies + description: | + #### Allowed For + + * Admins + parameters: + - name: group_sla_policy_ids + in: query + description: The ids of the Group SLA policies to reorder + schema: + type: array + items: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/groups: + get: + operationId: ListGroups + tags: + - Groups + summary: List Groups + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + * Agents + parameters: + - $ref: '#/components/parameters/ExcludeDeleted' + - $ref: '#/components/parameters/GroupsInclude' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupsResponse' + examples: + default: + $ref: '#/components/examples/GroupsResponseExample' + post: + operationId: CreateGroup + tags: + - Groups + summary: Create Group + description: | + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage groups (Enterprise only) + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupResponse' + examples: + default: + $ref: '#/components/examples/GroupCreateResponseExample' + /api/v2/groups/{group_id}: + parameters: + - $ref: '#/components/parameters/GroupId' + get: + operationId: ShowGroupById + tags: + - Groups + summary: Show Group + description: | + #### Allowed For + + * Admins + * Agents + parameters: + - $ref: '#/components/parameters/GroupsInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupResponse' + examples: + default: + $ref: '#/components/examples/GroupResponseExample' + put: + operationId: UpdateGroup + tags: + - Groups + summary: Update Group + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupResponse' + examples: + default: + $ref: '#/components/examples/GroupUpdateResponseExample' + delete: + operationId: DeleteGroup + tags: + - Groups + summary: Delete Group + description: | + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage groups (Enterprise only) + responses: + "204": + description: No content response + /api/v2/groups/{group_id}/memberships: + parameters: + - $ref: '#/components/parameters/GroupId' + get: + operationId: ListGroupMembershipsByGroup + tags: + - Group Memberships + - Groups + summary: List Memberships By Group + description: | + Returns a list of all group memberships for a specific group. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + /api/v2/groups/{group_id}/memberships/assignable: + parameters: + - $ref: '#/components/parameters/GroupId' + get: + operationId: ListAssignableGroupMembershipsByGroup + tags: + - Group Memberships + - Groups + summary: List Assignable Memberships By Group + description: | + Returns a list of assignable group memberships for a specific group. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + /api/v2/groups/{group_id}/users: + parameters: + - $ref: '#/components/parameters/GroupId' + get: + operationId: ListGroupUsers + tags: + - Users + - Groups + summary: List Users By Group + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + - $ref: '#/components/parameters/UserExternalIdFilter' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/UsersResponseExample' + /api/v2/groups/{group_id}/users/count: + parameters: + - $ref: '#/components/parameters/GroupId' + get: + operationId: CountGroupUsers + tags: + - Users + - Groups + summary: Count Users By Group + description: | + Returns an approximate count of users in the specified group. If the count exceeds 100,000, it is updated every 24 hours. + + The response includes a `refreshed_at` property in a `count` object that contains a timestamp indicating when the count was last updated. + + **Note**: When the count exceeds 100,000, the `refreshed_at` property may occasionally be null. + This indicates that the count is being updated in the background. The `count` object's `value` property is limited to 100,000 until the update is complete. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountResponse' + examples: + default: + $ref: '#/components/examples/UserCountResponseExample' + /api/v2/groups/assignable: + get: + operationId: ListAssignableGroups + tags: + - Groups + summary: List Assignable Groups + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupsResponse' + examples: + default: + $ref: '#/components/examples/GroupsResponseExample' + /api/v2/groups/count: + get: + operationId: CountGroups + tags: + - Groups + summary: Count Groups + description: | + Returns an approximate count of groups. If the count exceeds 100,000, it is updated every 24 hours. + + The `refreshed_at` property of the `count` object is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `refreshed_at` may occasionally be null. This indicates that the count is being updated in the background, and the `value` property of the `count` object is limited to 100,000 until the update is complete. + + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupsCountObject' + examples: + default: + $ref: '#/components/examples/GroupsCountResponseExample' + /api/v2/imports/tickets: + post: + operationId: TicketImport + tags: + - Ticket Import + summary: Ticket Import + description: |- + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ArchiveImmediately' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketImportRequest' + examples: + default: + $ref: '#/components/examples/TicketImportRequestExample' + responses: + "201": + description: Successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/TicketResponse' + examples: + default: + $ref: '#/components/examples/TicketResponseExample' + /api/v2/imports/tickets/create_many: + post: + operationId: TicketBulkImport + tags: + - Ticket Import + summary: Ticket Bulk Import + description: |- + Accepts an array of up to 100 ticket objects. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ArchiveImmediately' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketBulkImportRequest' + examples: + default: + $ref: '#/components/examples/TicketBulkImportRequestExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/incremental/{incremental_resource}/sample: + parameters: + - $ref: '#/components/parameters/IncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalResource' + get: + operationId: IncrementalSampleExport + tags: + - Incremental Export + summary: Incremental Sample Export + description: | + Use this endpoint to test the incremental export format. It's more strict in terms of rate limiting, + at 10 requests per 20 minutes instead of 10 requests per minute. It also returns only up to 50 + results per request. Otherwise, it's identical to the above APIs. + + Use the `incremental_resource` parameter to specify the resource. Possible values are "tickets", "ticket_events", "users", or "organizations". + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TimeBasedExportIncrementalTicketsResponse' + examples: + default: + $ref: '#/components/examples/TimeBasedExportIncrementalTicketsResponseExample' + /api/v2/incremental/custom_objects/{custom_object_key}/cursor: + parameters: + - $ref: '#/components/parameters/OptionalIncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalCursor' + - name: custom_object_key + in: path + description: The key identifier for the custom object + required: true + schema: + type: string + example: apartment + - name: per_page + in: query + description: Number of records to return per page (default 1000, maximum 1000) + schema: + type: integer + default: 1000 + minimum: 1 + maximum: 1000 + - name: filter[exclude_deleted] + in: query + description: If true, exclude deleted records from the export + schema: + type: boolean + default: false + get: + operationId: IncrementalCustomObjectRecordExportCursor + tags: + - Custom Object Records + - Incremental Export + summary: Incremental Custom Object Record Export, Cursor Based + description: "Returns the custom object records that changed since the start time. This endpoint supports \ncursor-based incremental exports for custom object records.\n\nThis endpoint only supports cursor-based pagination and does not support offset-based pagination.\nCursor-based exports provide more consistent performance and response body sizes. For more information, \nsee [Cursor-based incremental exports](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#cursor-based-incremental-exports) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api).\n\n#### Allowed For\n\n* Admins\n* Agents with custom object read permissions\n\n#### Rate Limiting\n\nYou can make up to 10 requests per minute to this endpoint.\n\n#### Notes\n\n- `start_time` is only required for the initial request for the pages in the record set, then `cursor` is required for all subsequent requests\n- The `start_time` must be more than 60 seconds ago\n- Deleted records will have their field values replaced with \"[DELETED]\" unless excluded via filter\n- Photo fields are excluded from incremental export responses\n" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/IncrementalCustomObjectRecordsResponse' + examples: + default: + $ref: '#/components/examples/IncrementalCustomObjectRecordsResponseExample' + "400": + description: Bad request - Invalid parameters + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + status: + type: string + title: + type: string + examples: + default: + value: + errors: + - code: StartTimeTooRecent + status: "400" + title: start_time must be more than 60 seconds ago + invalid_cursor: + value: + errors: + - code: InvalidCursor + status: "400" + title: cursor is invalid or expired + start_time_too_recent: + value: + errors: + - code: StartTimeTooRecent + status: "400" + title: start_time must be more than 60 seconds ago + "401": + description: Unauthorized - Authentication required + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + status: + type: string + title: + type: string + examples: + default: + value: + errors: + - code: Unauthorized + status: "401" + title: Authentication required + unauthorized: + value: + errors: + - code: Unauthorized + status: "401" + title: Authentication required + "403": + description: Forbidden - Insufficient permissions to access custom objects + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + status: + type: string + title: + type: string + examples: + default: + value: + errors: + - code: Forbidden + status: "403" + title: Insufficient permissions to access custom objects + forbidden: + value: + errors: + - code: Forbidden + status: "403" + title: Insufficient permissions to access custom objects + "404": + description: Not found - Custom object not found or feature not enabled + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + status: + type: string + title: + type: string + examples: + custom_object_not_found: + value: + errors: + - code: CustomObjectNotFound + status: "404" + title: Custom object not found + default: + value: + errors: + - code: CustomObjectNotFound + status: "404" + title: Custom object not found + feature_not_enabled: + value: + errors: + - code: FeatureNotEnabled + status: "404" + title: Custom objects feature is not enabled + "429": + description: Too many requests - Rate limit exceeded + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + status: + type: string + title: + type: string + examples: + default: + value: + errors: + - code: RateLimitExceeded + status: "429" + title: Rate limit exceeded. Maximum 10 requests per minute. + rate_limit_exceeded: + value: + errors: + - code: RateLimitExceeded + status: "429" + title: Rate limit exceeded. Maximum 10 requests per minute. + /api/v2/incremental/organizations: + parameters: + - $ref: '#/components/parameters/IncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalPage' + get: + operationId: IncrementalOrganizationExport + tags: + - Incremental Export + summary: Incremental Organization Export + description: | + #### Allowed For + + * Admins + + #### Sideloading + + See [Organizations sideloads](/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ExportIncrementalOrganizationsResponse' + examples: + default: + $ref: '#/components/examples/ExportIncrementalOrganizationsResponseExample' + /api/v2/incremental/routing/attribute_values: + get: + operationId: IncrementalSkilBasedRoutingAttributeValuesExport + tags: + - Incremental Skill Based Routing + summary: Incremental Attributes Values Export + description: | + Returns a stream of changes that occurred on routing attribute values. + + #### Allowed For + + * Admins + + #### Parameters + + Optional + + | Name | Type | Comment + | ------ | ------ | ------- + | cursor | string | The `cursor` parameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. See [Pagination](#pagination). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/IncrementalSkillBasedRouting' + examples: + default: + $ref: '#/components/examples/IncrementalSkillBasedRoutingAttributeValuesExample' + /api/v2/incremental/routing/attributes: + get: + operationId: IncrementalSkilBasedRoutingAttributesExport + tags: + - Incremental Skill Based Routing + summary: Incremental Attributes Export + description: | + Returns a stream of changes that occurred on routing attributes. + + #### Allowed For + + * Admins + + #### Parameters + + Optional + + + | Name | Type | Comment + | ------ | ------ | ------- + | cursor | string | The `cursor` parameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. See [Pagination](#pagination). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/IncrementalSkillBasedRouting' + examples: + default: + $ref: '#/components/examples/IncrementalSkillBasedRoutingAttributesExample' + /api/v2/incremental/routing/instance_values: + get: + operationId: IncrementalSkilBasedRoutingInstanceValuesExport + tags: + - Incremental Skill Based Routing + summary: Incremental Instance Values Export + description: | + Returns a stream of changes that occurred on routing instance values. Changes are grouped by `attribute_value_id`, + with associate type events listed alongside unassociate type events based on the unassociate event’s timestamp. + + #### Allowed For + + * Admins + + #### Parameters + + Optional + + | Name | Type | Comment + | ------ | ------ | ------- + | cursor | string | The `cursor` parameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. See [Pagination](#pagination). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/IncrementalSkillBasedRouting' + examples: + default: + $ref: '#/components/examples/IncrementalSkillBasedRoutingInstanceValuesExample' + /api/v2/incremental/ticket_events: + parameters: + - $ref: '#/components/parameters/IncrementalUnixTime' + - $ref: '#/components/parameters/TicketSupportTypeScope' + get: + operationId: IncrementalTicketEvents + tags: + - Incremental Export + summary: Incremental Ticket Event Export + description: | + Returns a stream of changes that occurred on tickets, excluding events occuring within one minute of the request. Each event is tied + to an update on a ticket and contains all the fields that were updated in that + change. For more information, see: + + - [Exporting ticket events](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#exporting-ticket-events) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api) + - [Time-based incremental exports](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#time-based-incremental-exports) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api) + + You can include comments in the event stream by using the `comment_events` + sideload. See Sideloading below. If you don't specify the sideload, any comment + present in the ticket update is described only by Boolean `comment_present` + and `comment_public` object properties in the event's `child_events` array. + The comment itself is not included. + + #### Allowed For + + * Admins + + #### Sideloading + + The endpoint supports the `comment_events` sideload. Any comment present in the ticket + update is listed as an object in the event's `child_events` array. Example: + + ```js + "child_events": [ + { + "id": 91048994488, + "via": { + "channel": "api", + "source": {"from":{},"to":{},"rel":null}}, + "via_reference_id":null, + "type": "Comment", + "author_id": 5031726587, + "body": "This is a comment", + "html_body": "<div class="zd-comment"><p dir="auto">This is a comment</p>", + "public": true, + "attachments": [], + "audit_id": 91048994468, + "created_at": "2009-06-25T10:15:18Z", + "event_type": "Comment" + }, + ... + ], + ... + ``` + parameters: + - $ref: '#/components/parameters/IncrementalTicketEventsInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ExportIncrementalTicketEventsResponse' + examples: + default: + $ref: '#/components/examples/ExportIncrementalTicketEventsResponseExample' + /api/v2/incremental/ticket_metric_events: + get: + operationId: ListTicketMetricEvents + tags: + - Ticket Metric Events + summary: List Ticket Metric Events + description: |- + Returns ticket metric events that occurred on or after the start time. + + Cursor pagination returns a maximum of 100 records per page. Events are listed in chronological order. + + If the results are not paginated, events will be returned as a time-based incremental export. + + See [Time-based incremental exports](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#time-based-incremental-exports). + + #### Pagination + * Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Allowed For + + * Admins + parameters: + - name: start_time + in: query + description: 'The Unix UTC epoch time of the oldest event you''re interested in. Example: 1332034771.' + required: true + schema: + type: integer + example: 1332034771 + - name: include_changes + in: query + description: This optional parameter enhances incremental data retrieval, delivering a consistent and accurate representation of data changes. + schema: + type: boolean + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketMetricEventsResponse' + examples: + default: + $ref: '#/components/examples/TicketMetricEventsResponseExample' + /api/v2/incremental/tickets: + parameters: + - $ref: '#/components/parameters/IncrementalUnixTime' + - $ref: '#/components/parameters/TicketSupportTypeScope' + get: + operationId: IncrementalTicketExportTime + tags: + - Incremental Export + summary: Incremental Ticket Export, Time Based + description: | + Returns the tickets that changed since the start time. For more information, + see [Exporting tickets](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#exporting-tickets) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api). + + This endpoint supports time-based incremental exports. + For more information, see [Time-based incremental exports](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#time-based-incremental-exports) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api). You can also return tickets using cursor-based pagination. See [Incremental Ticket Export, Cursor Based](#incremental-ticket-export-cursor-based). + + The results include tickets that were updated by the system. See + [Excluding system-updated tickets](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#excluding-system-updated-tickets-time-based-exports) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api). + + The endpoint can return tickets with an `updated_at` time that's earlier than the + `start_time` time. The reason is that the API compares the `start_time` with the ticket's + `generated_timestamp` value, not its `updated_at` value. The `updated_at` value is + updated only if the update generates a [ticket event](#incremental-ticket-event-export). + The `generated_timestamp` value is updated for all ticket updates, including system + updates. If a system update occurs after a ticket event, the unchanged + `updated_at` time will become earlier relative to the updated `generated_timestamp` + time. + + #### Allowed For + + * Admins + + #### Sideloading + + See [Tickets sideloads](/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints). For performance reasons, + `last_audits` sideloads aren't supported. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TimeBasedExportIncrementalTicketsResponse' + examples: + default: + $ref: '#/components/examples/TimeBasedExportIncrementalTicketsResponseExample' + /api/v2/incremental/tickets/cursor: + parameters: + - $ref: '#/components/parameters/OptionalIncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalCursor' + - $ref: '#/components/parameters/TicketSupportTypeScope' + get: + operationId: IncrementalTicketExportCursor + tags: + - Incremental Export + summary: Incremental Ticket Export, Cursor Based + description: | + Returns the tickets that changed since the start time. For more information, + see [Exporting tickets](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#exporting-tickets) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api). + + This endpoint supports cursor-based incremental exports. + Cursor-based exports are highly encouraged because they provide more consistent performance and + response body sizes. For more information, see [Cursor-based incremental exports](/documentation/ticketing/managing-tickets/using-the-incremental-export-api#cursor-based-incremental-exports) in [Using the Incremental Exports API](/documentation/ticketing/managing-tickets/using-the-incremental-export-api). + + + + #### Allowed For + + * Admins + + #### Sideloading + + See [Tickets sideloads](/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints). For performance reasons, + `last_audits` sideloads aren't supported. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CursorBasedExportIncrementalTicketsResponse' + examples: + default: + $ref: '#/components/examples/CursorBasedExportIncrementalTicketsResponseExample' + /api/v2/incremental/users: + parameters: + - $ref: '#/components/parameters/IncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalPage' + get: + operationId: IncrementalUserExportTime + tags: + - Incremental Export + summary: Incremental User Export, Time Based + description: | + #### Allowed For + + * Admins + + #### Sideloading + + See [Users sideloads](/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TimeBasedExportIncrementalUsersResponse' + examples: + default: + $ref: '#/components/examples/TimeBasedExportIncrementalUsersResponseExample' + /api/v2/incremental/users/cursor: + parameters: + - $ref: '#/components/parameters/OptionalIncrementalUnixTime' + - $ref: '#/components/parameters/IncrementalCursor' + - $ref: '#/components/parameters/IncrementalPage' + get: + operationId: IncrementalUserExportCursor + tags: + - Incremental Export + summary: Incremental User Export, Cursor Based + description: | + #### Allowed For + + * Admins + + #### Sideloading + + See [Users sideloads](/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CursorBasedExportIncrementalUsersResponse' + examples: + default: + $ref: '#/components/examples/CursorBasedExportIncrementalUsersResponseExample' + /api/v2/it_asset_management/asset_types: + get: + operationId: ListItamAssetTypes + tags: + - ITAM Asset Types + summary: List Asset Types + description: |- + Lists all asset types. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypesResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetTypesIndexResponseExample' + post: + operationId: CreateItamAssetType + tags: + - ITAM Asset Types + summary: Create Asset Type + description: | + Creates an asset type. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypeCreateRequest' + examples: + default: + $ref: '#/components/examples/ItamAssetTypeCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypeResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetTypeResponseExample' + /api/v2/it_asset_management/asset_types/{asset_type_id}: + get: + operationId: ShowItamAssetType + tags: + - ITAM Asset Types + summary: Show Asset Type + description: | + Returns an asset type with the specified id. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + responses: + "200": + description: Asset type + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypeResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetTypeResponseExample' + patch: + operationId: UpdateItamAssetType + tags: + - ITAM Asset Types + summary: Update Asset Type + description: |- + Updates an existing asset type. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypeResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetTypeResponseExample' + delete: + operationId: DeleteItamAssetType + tags: + - ITAM Asset Types + summary: Delete Asset Type + description: |- + Deletes an asset type with the specified id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + responses: + "204": + description: No content response + /api/v2/it_asset_management/asset_types/{asset_type_id}/fields: + get: + operationId: ListItamAssetTypeFields + tags: + - ITAM Asset Fields + summary: List Asset Fields + description: |- + Lists all standard and custom fields for an asset type. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetTypeFieldsResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetTypeFieldsIndexResponseExample' + post: + operationId: CreateItamAssetTypeField + tags: + - ITAM Asset Fields + summary: Create Asset Field + description: |- + Creates an asset field for an individual asset type. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetFieldCreateRequest' + examples: + default: + $ref: '#/components/examples/ItamAssetFieldCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetFieldResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetFieldResponseExample' + /api/v2/it_asset_management/asset_types/{asset_type_id}/fields/{asset_type_field_id}: + get: + operationId: ShowItamAssetTypeField + tags: + - ITAM Asset Fields + summary: Show Asset Field + description: | + Returns an asset field with the specified id. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + - $ref: '#/components/parameters/ItamAssetTypeFieldId' + responses: + "200": + description: Asset field + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetFieldResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetFieldResponseExample' + patch: + operationId: UpdateItamAssetTypeField + tags: + - ITAM Asset Fields + summary: Update Asset Field + description: |- + Updates an existing asset field with the specified id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + - $ref: '#/components/parameters/ItamAssetTypeFieldId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetFieldResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetFieldResponseExample' + delete: + operationId: DeleteItamAssetTypeField + tags: + - ITAM Asset Fields + summary: Delete Asset Field + description: |- + Deletes an asset field with the specified id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetTypeId' + - $ref: '#/components/parameters/ItamAssetTypeFieldId' + responses: + "204": + description: No content response + /api/v2/it_asset_management/assets: + get: + operationId: ListItamAssets + tags: + - ITAM Assets + summary: List Assets + description: |- + Lists all assets for all asset types. + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetsResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetsIndexResponseExample' + post: + operationId: CreateItamAsset + tags: + - ITAM Assets + summary: Create Asset + description: | + Creates an asset. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetCreateRequest' + examples: + default: + $ref: '#/components/examples/ItamAssetCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetResponseExample' + /api/v2/it_asset_management/assets/{asset_id}: + get: + operationId: ShowItamAsset + tags: + - ITAM Assets + summary: Show Asset + description: | + Returns the asset with the specified id. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetId' + responses: + "200": + description: Asset + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetResponseExample' + patch: + operationId: UpdateItamAsset + tags: + - ITAM Assets + summary: Update Asset + description: |- + Updates an individual asset. This request takes an `asset` object that specifies the properties to update, with custom field values nested within a `custom_field_values` object. Values are updated only for the properties specified in the request. Any asset properties that aren't specified in the request are unaffected, and their values are preserved for the asset. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetResponseExample' + delete: + operationId: DeleteItamAsset + tags: + - ITAM Assets + summary: Delete Asset + description: |- + Deletes an asset with the specified id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetId' + responses: + "204": + description: No content response + /api/v2/it_asset_management/assets/jobs: + post: + operationId: ItamAssetBulkJobs + tags: + - ITAM Assets + summary: Asset Bulk Jobs + description: | + Queues a background job to perform bulk actions on up to 100 asset records per request. + Takes a `job` object with two nested fields: + * `action`, one of: + * `"create"` + * `"update"` + * `"delete"` + * `"delete_by_external_id"` + * `items` + * For a `"create"` action, an array of JSON objects representing the assets being created + * For an `"update"` action, an array of JSON objects representing the assets being updated (must include `id` attribute) + * For a `"delete"` action, an array of strings representing Zendesk asset ids + * For a `"delete_by_external_id"` action, an array of strings representing external ids + + Note: For create and update actions, the `asset_type_id`, `status_id`, and `location_id` fields can be specified using either the ID or the name of the resource. For example, you can use `"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H"` or `"asset_type": "Laptop"`. + + #### Allowed For + * Admins + + #### Response + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetBulkJobRequest' + examples: + default: + $ref: '#/components/examples/ItamAssetBulkJobRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetBulkJobResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetBulkJobResponseExample' + /api/v2/it_asset_management/locations: + get: + operationId: ListItamLocations + tags: + - ITAM Asset Locations + summary: List Asset Locations + description: |- + Lists all locations. + + #### Pagination + + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetLocationsResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetLocationsIndexResponseExample' + post: + operationId: CreateItamLocation + tags: + - ITAM Asset Locations + summary: Create Asset Location + description: | + Creates a location. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetLocationCreateRequest' + examples: + default: + $ref: '#/components/examples/ItamAssetLocationCreateRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetLocationResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetLocationResponseExample' + /api/v2/it_asset_management/locations/{location_id}: + get: + operationId: ShowItamLocation + tags: + - ITAM Asset Locations + summary: Show Asset Location + description: | + Returns the location with the specified id. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetLocationId' + responses: + "200": + description: Location + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetLocationResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetLocationResponseExample' + patch: + operationId: UpdateItamLocation + tags: + - ITAM Asset Locations + summary: Update Asset Location + description: |- + Updates an existing location. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetLocationId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetLocationResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetLocationResponseExample' + delete: + operationId: DeleteItamLocation + tags: + - ITAM Asset Locations + summary: Delete Asset Location + description: |- + Deletes a location with the specified id. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/ItamAssetLocationId' + responses: + "204": + description: No content response + /api/v2/it_asset_management/statuses: + get: + operationId: ListItamStatuses + tags: + - ITAM Asset Statuses + summary: List Asset Statuses + description: |- + Lists all statuses. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetStatusesResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetStatusesIndexResponseExample' + /api/v2/it_asset_management/statuses/{status_id}: + get: + operationId: ShowItamStatus + tags: + - ITAM Asset Statuses + summary: Show Asset Status + description: | + Returns the status with the specified id. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/ItamAssetStatusId' + responses: + "200": + description: Asset Status + content: + application/json: + schema: + $ref: '#/components/schemas/ItamAssetStatusResponse' + examples: + default: + $ref: '#/components/examples/ItamAssetStatusResponseExample' + /api/v2/job_statuses: + get: + operationId: ListJobStatuses + tags: + - Job Statuses + summary: List Job Statuses + description: | + Shows the statuses for background jobs. Statuses are sorted first by completion date and then by creation date in descending order. + + #### Allowed For: + + * Agents + + #### Pagination + + * Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusesResponse' + examples: + default: + $ref: '#/components/examples/JobStatusesResponseExample' + /api/v2/job_statuses/{job_status_id}: + parameters: + - $ref: '#/components/parameters/JobStatusId' + get: + operationId: ShowJobStatus + tags: + - Job Statuses + summary: Show Job Status + description: | + Shows the status of a background job. + + #### Allowed For: + + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ShowJobStatusResponseExample' + /api/v2/job_statuses/show_many: + get: + operationId: ShowManyJobStatuses + tags: + - Job Statuses + summary: Show Many Job Statuses + description: | + Accepts a comma-separated list of job status ids. + + #### Allowed For: + + * Agents + parameters: + - name: ids + in: query + description: Comma-separated list of job status ids. + required: true + schema: + type: string + example: 8b726e606741012ffc2d782bcb7848fe,e7665094164c498781ebe4c8db6d2af5 + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusesResponse' + examples: + default: + $ref: '#/components/examples/JobStatusesResponseExample' + /api/v2/locales: + get: + operationId: ListLocales + tags: + - Locales + summary: List Locales + description: | + Lists the translation locales available for the account. + + **Note**: You can alter the list by passing an updated `locale_ids` array to the [Update Account Settings](/api-reference/ticketing/account-configuration/account_settings/#update-account-settings) endpoint. + + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/LocalesResponse' + examples: + default: + $ref: '#/components/examples/LocalesResponseExample' + /api/v2/locales/{locale_id}: + parameters: + - $ref: '#/components/parameters/LocaleId' + get: + operationId: ShowLocaleById + tags: + - Locales + summary: Show Locale + description: | + #### Allowed For + + * Anyone + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/LocaleResponse' + examples: + default: + $ref: '#/components/examples/LocaleResponseExample' + /api/v2/locales/agent: + get: + operationId: ListLocalesForAgent + tags: + - Locales + summary: List Locales for Agent + description: | + Lists the translation locales that have been localized for agents on a specific account. + + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/LocalesResponse' + examples: + default: + $ref: '#/components/examples/LocalesResponseExample' + /api/v2/locales/current: + get: + operationId: ShowCurrentLocale + tags: + - Locales + summary: Show Current Locale + description: | + This works like [Show Locale](#show-locale), but instead of taking a locale id as an argument, it renders the locale of the user performing the request. + + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/LocaleResponse' + examples: + default: + $ref: '#/components/examples/LocaleResponseExample' + /api/v2/locales/detect_best_locale: + get: + operationId: DetectBestLocale + tags: + - Locales + summary: Detect Best Language for User + description: | + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/LocaleResponse' + examples: + default: + $ref: '#/components/examples/LocaleDetectBestLanguageResponseExample' + /api/v2/locales/public: + get: + operationId: ListAvailablePublicLocales + tags: + - Locales + summary: List Available Public Locales + description: | + Lists the translation locales that are available to all accounts. + + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/LocalesResponse' + examples: + default: + $ref: '#/components/examples/LocalesResponseExample' + /api/v2/macros: + get: + operationId: ListMacros + tags: + - Macros + summary: List Macros + description: | + Lists all shared and personal macros available to the current user. For admins, the API returns all macros for the account, including the personal macros of agents and other admins. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/MacroInclude' + - $ref: '#/components/parameters/MacroAccess' + - $ref: '#/components/parameters/MacroActive' + - $ref: '#/components/parameters/MacroCategory' + - $ref: '#/components/parameters/MacroGroupId' + - $ref: '#/components/parameters/MacroOnlyViewable' + - $ref: '#/components/parameters/MacroSortBy' + - $ref: '#/components/parameters/MacroSortOrder' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacrosResponse' + examples: + default: + $ref: '#/components/examples/MacrosResponseExample' + post: + operationId: CreateMacro + tags: + - Macros + summary: Create Macro + description: | + #### Allowed For + * Agents + requestBody: + content: + application/json: + schema: + type: object + properties: + macro: + $ref: '#/components/schemas/MacroInput' + examples: + default: + value: + macro: + actions: + - field: status + value: solved + title: Roger Wilco + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + macro: + $ref: '#/components/schemas/MacroObject' + examples: + default: + $ref: '#/components/examples/CreateMacroResponseExample' + /api/v2/macros/{macro_id}: + parameters: + - $ref: '#/components/parameters/MacroId' + get: + operationId: ShowMacro + tags: + - Macros + summary: Show Macro + description: | + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroResponse' + examples: + default: + $ref: '#/components/examples/MacroResponseExample' + put: + operationId: UpdateMacro + tags: + - Macros + summary: Update Macro + description: | + #### Allowed For + * Agents + requestBody: + content: + application/json: + schema: + type: object + properties: + macro: + $ref: '#/components/schemas/MacroInput' + examples: + default: + value: + macro: + actions: + - field: status + value: solved + title: Sets the ticket status to `solved` + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + macro: + $ref: '#/components/schemas/MacroObject' + examples: + default: + $ref: '#/components/examples/UpdateMacroResponseExample' + delete: + operationId: DeleteMacro + tags: + - Macros + summary: Delete Macro + description: | + #### Allowed For + * Agents, with restrictions applying on certain actions + responses: + "204": + description: No Content + /api/v2/macros/{macro_id}/apply: + parameters: + - $ref: '#/components/parameters/MacroId' + get: + operationId: ShowChangesToTicket + tags: + - Macros + summary: Show Changes to Ticket + description: | + Returns the changes the macro would make to a ticket. It doesn't actually + change a ticket. You can use the response data in a subsequent API call + to the [Tickets](/api-reference/ticketing/tickets/tickets/) endpoint to update the ticket. + + The response includes only the ticket fields that would be changed by the + macro. To get the full ticket object after the macro is applied, + see [Show Ticket After Changes](#show-ticket-after-changes). + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroApplyTicketResponse' + examples: + default: + $ref: '#/components/examples/MacroChangesToTicketsResponseExample' + /api/v2/macros/{macro_id}/attachments: + parameters: + - $ref: '#/components/parameters/MacroId' + get: + operationId: ListMacroAttachments + tags: + - Macros + summary: List Macro Attachments + description: | + Lists the attachments associated with a macro. + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroAttachmentsResponse' + examples: + default: + $ref: '#/components/examples/MacroAttachmentsResponseExample' + post: + operationId: CreateAssociatedMacroAttachment + tags: + - Macros + summary: Create Macro Attachment + description: | + Allows an attachment to be uploaded and associated with a macro at the same time. + + **Note:** A macro can be associated with up to five attachments. + + #### Allowed For + + * Agents + responses: + "201": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroAttachmentResponse' + examples: + default: + $ref: '#/components/examples/MacroAttachmentResponseExample' + /api/v2/macros/actions: + get: + operationId: ListMacrosActions + tags: + - Macros + summary: List Supported Actions for Macros + description: | + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + type: object + properties: + actions: + type: array + items: + type: object + additionalProperties: true + examples: + default: + $ref: '#/components/examples/MacroActionsResponseExample' + /api/v2/macros/active: + get: + operationId: ListActiveMacros + tags: + - Macros + summary: List Active Macros + description: | + Lists all active shared and personal macros available to the current user. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/MacroInclude' + - $ref: '#/components/parameters/MacroAccess' + - $ref: '#/components/parameters/MacroCategory' + - $ref: '#/components/parameters/MacroGroupId' + - $ref: '#/components/parameters/MacroSortBy' + - $ref: '#/components/parameters/MacroSortOrder' + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacrosResponse' + examples: + default: + $ref: '#/components/examples/MacrosResponseExample' + /api/v2/macros/attachments: + post: + operationId: CreateMacroAttachment + tags: + - Macros + summary: Create Unassociated Macro Attachment + description: | + Allows an attachment to be uploaded that can be associated with a macro at a later time. + + **Note:** To ensure an uploaded attachment is not lost, associate it with a macro as soon as possible. From time to time, old attachments that are not not associated with any macro are purged. + + #### Allowed For + + * Agents + responses: + "201": + description: Created Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroAttachmentResponse' + examples: + default: + $ref: '#/components/examples/MacroAttachmentResponseExample' + /api/v2/macros/attachments/{attachment_id}: + parameters: + - $ref: '#/components/parameters/AttachmentId' + get: + operationId: ShowMacroAttachment + tags: + - Macros + summary: Show Macro Attachment + description: | + Shows the properties of the specified macro attachment. + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroAttachmentResponse' + examples: + default: + $ref: '#/components/examples/MacroAttachmentResponseExample' + /api/v2/macros/categories: + get: + operationId: ListMacroCategories + tags: + - Macros + summary: List Macro Categories + description: | + Lists all macro categories available to the current user. + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroCategoriesResponse' + examples: + default: + $ref: '#/components/examples/MacroCategoriesResponseExample' + /api/v2/macros/definitions: + get: + operationId: ListMacroActionDefinitions + tags: + - Macros + summary: List Macro Action Definitions + description: | + Returns the definitions of the actions a macro can perform. For example, + one action can set the status of a ticket. The definition of the action + includes a title ("Status"), a type ("list"), and possible values. For a + list of support actions, see [Actions reference](/documentation/ticketing/reference-guides/actions-reference). + + #### Allowed For + + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + type: object + properties: + definitions: + type: object + properties: + actions: + type: array + items: + type: object + additionalProperties: true + examples: + default: + $ref: '#/components/examples/ShowDerivedMacroResponseExample' + /api/v2/macros/destroy_many: + delete: + operationId: DeleteManyMacros + tags: + - Macros + summary: Bulk Delete Macros + description: | + Deletes the macros corresponding to the provided comma-separated list of IDs. + + #### Allowed For + * Agents + parameters: + - name: ids + in: query + description: The IDs of the macros to delete + required: true + schema: + type: array + items: + type: integer + example: + - 1 + - 2 + - 3 + responses: + "204": + description: No Content + /api/v2/macros/new: + parameters: + - $ref: '#/components/parameters/MacroIdQuery' + - name: ticket_id + in: query + description: The ID of the ticket from which to build a macro replica + required: true + schema: + type: integer + example: 35436 + get: + operationId: ShowDerivedMacro + tags: + - Macros + summary: Show Macro Replica + description: | + Returns an unpersisted macro representation derived from a ticket or macro. + + The endpoint takes one of the following query parameters: `macro_id` or `ticket_id`. If you include both, `macro_id` is used. + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroResponse' + examples: + default: + $ref: '#/components/examples/MacroResponseExample' + /api/v2/macros/search: + parameters: + - $ref: '#/components/parameters/MacroInclude' + - $ref: '#/components/parameters/MacroAccess' + - $ref: '#/components/parameters/MacroActive' + - $ref: '#/components/parameters/MacroCategory' + - $ref: '#/components/parameters/MacroGroupId' + - $ref: '#/components/parameters/MacroOnlyViewable' + - $ref: '#/components/parameters/MacroSearchSortBy' + - $ref: '#/components/parameters/MacroSortOrder' + - $ref: '#/components/parameters/MacroQuery' + get: + operationId: SearchMacro + tags: + - Macros + summary: Search Macros + description: | + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacrosResponse' + examples: + default: + $ref: '#/components/examples/MacrosResponseExample' + /api/v2/macros/update_many: + put: + operationId: UpdateManyMacros + tags: + - Macros + summary: Update Many Macros + description: | + Updates the provided macros with the specified changes. + + #### Allowed For + * Agents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MacroUpdateManyInput' + examples: + default: + value: + macros: + - active: false + id: 25 + - id: 23 + position: 5 + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacrosResponse' + examples: + default: + $ref: '#/components/examples/MacrosResponseExample' + /api/v2/oauth/clients: + get: + operationId: ListOAuthClients + tags: + - OAuth Clients + summary: List Clients + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientsResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientsResponseExample' + post: + operationId: CreateOAuthClient + tags: + - OAuth Clients + summary: Create Client + description: | + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OauthClientResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientResponseExample' + /api/v2/oauth/clients/{oauth_client_id}: + parameters: + - $ref: '#/components/parameters/OAuthClientId' + get: + operationId: ShowClient + tags: + - OAuth Clients + summary: Show Client + description: | + #### Allowed for + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OauthClientResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientResponseExample' + put: + operationId: UpdateClient + tags: + - OAuth Clients + summary: Update Client + description: | + #### Allowed for + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OauthClientResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientUpdateResponseExample' + delete: + operationId: DeleteClient + tags: + - OAuth Clients + summary: Delete Client + description: | + #### Allowed for + * Admins + responses: + "204": + description: No content response + /api/v2/oauth/clients/{oauth_client_id}/generate_secret: + parameters: + - $ref: '#/components/parameters/OAuthClientId' + put: + operationId: ClientGenerateSecret + tags: + - OAuth Clients + summary: Generate Secret + description: | + #### Allowed for + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OauthClientResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientResponseExample' + /api/v2/oauth/global_clients: + get: + operationId: ListGlobalOAuthClients + tags: + - Global Clients + summary: List Global OAuth Clients + description: | + Returns all the global OAuth clients that users on your account have authorized. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalClientsResponse' + examples: + default: + $ref: '#/components/examples/GlobalClientsResponseExample' + /api/v2/oauth/global_clients/{global_client_id}: + parameters: + - $ref: '#/components/parameters/GlobalClientId' + get: + operationId: ShowGlobalClient + tags: + - Global Clients + summary: Show Global OAuth Client + description: | + Returns the global OAuth client associated with the ID sent on the request. + + #### Allowed for + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalClientResponse' + examples: + default: + $ref: '#/components/examples/GlobalClientResponseExample' + /api/v2/oauth/global_clients/token_summary: + parameters: + - $ref: '#/components/parameters/OAuthGlobalClientIdQuery' + - $ref: '#/components/parameters/GlobalClientTokenSummaryIncludeExpiredTokensQuery' + get: + operationId: GlobalOAuthClientsTokenSummary + tags: + - Global Clients + summary: Show Token summary for Global OAuth Clients + description: | + Returns information about tokens for the global clients that your account has authorized. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalClientsTokenSummaryResponse' + examples: + default: + $ref: '#/components/examples/GlobalClientsTokenSummaryResponseExample' + /api/v2/oauth/tokens: + parameters: + - $ref: '#/components/parameters/OAuthClientIdQuery' + - $ref: '#/components/parameters/OAuthGlobalClientIdQuery' + - $ref: '#/components/parameters/OAuthAllTokensQuery' + get: + operationId: ListOAuthTokens + tags: + - OAuth Tokens + summary: List Tokens + description: | + Returns the properties of the tokens for the current user. Admins can view OAuth token properties for all users using the [all](/api-reference/ticketing/oauth/oauth_tokens/#parameters) parameter. To filter the list by OAuth client, use the [client_id](/api-reference/ticketing/oauth/oauth_tokens/#parameters) parameter for a local OAuth client ID, or the [global_client_id](/api-reference/ticketing/oauth/oauth_tokens/#parameters) parameter for a global OAuth client ID. For security reasons, only the first 10 characters of each access token are included. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokensResponse' + examples: + default: + $ref: '#/components/examples/OAuthTokensResponseExample' + post: + operationId: CreateOAuthToken + tags: + - OAuth Tokens + summary: Create Token + description: | + Returns an OAuth access token with a specified [scope](#scopes). + + Refresh tokens aren't used. An access token doesn't expire but it can be [revoked](#revoke-token). + + For a tutorial, see [Creating and using OAuth tokens with the API](/documentation/ticketing/working-with-oauth/creating-and-using-oauth-tokens-with-the-api/). + + **Note**: For OAuth authorization code, use the [Create Token for Grant Type](/api-reference/ticketing/oauth/grant_type_tokens/#create-token-for-grant-type) endpoint. + The two APIs don't share the same path, JSON format, or request parameters. However, both APIs return access tokens that can be used to [authenticate API requests](/api-reference/ticketing/introduction/#oauth-access-token). + + #### Allowed For + + * Admins + + #### Request parameters + + The POST request takes a "token" object that contains an OAuth client's resource id and scopes. + + | Name | Type | Description + | --------- | ------- | -------------------------------------------------- + | client_id | integer | The resource `id` of an [OAuth client](/api-reference/ticketing/oauth/oauth_clients/#json-format) (not the client's unique identifier). For the ids, see [List Clients](/api-reference/ticketing/oauth/oauth_clients/#list-clients) + | scopes | array | Valid scopes for the token. See [Scopes](#scopes) below + + #### Scopes + + The **scopes** parameter defines whether requests authenticated with the token can + post, put, and delete data, or only get data. + + **Note**: Don't confuse the **scopes** parameter (plural) with the **scope** parameter (singular) + for [grant-type tokens](/api-reference/ticketing/oauth/grant_type_tokens/). + + The **scopes** parameter is an array of strings, each specifying a resource name and + an access setting. Access is either "read" or "write". If you don't specify a resource, + access to all resources is assumed. If you don't specify the access, read and write + access are assumed. + + The syntax is as follows: + + `"scopes": [resource:scope, ...]` + + where `resource` is optional. + + **Examples** + + `"scopes": ["read"]` + + `"scopes": ["tickets:read"]` + + To give read and write access to a resource, specify both scopes: + + `"scopes": ["users:read", "users:write"]` + + To give write access only to one resource and read access to everything + else: + + `"scopes": ["organizations:write", "read"]` + + **Note**: The endpoint returns an access token even if you specify an + invalid scope. Any request you make with the token will return + a "Forbidden" error. + + **Available scopes** + + * `read` - gives access to GET endpoints. Includes + permission to sideload related resources + * `write` - gives access to POST, PUT, and DELETE endpoints + * `impersonate` - allows Zendesk Support admins to make requests on behalf of + end users. See [Making API requests on behalf of end users](/documentation/ticketing/using-the-zendesk-api/making-api-requests-on-behalf-of-end-users/) + + **Resources that can be scoped** + + * tickets + * users + * auditlogs (read only) + * organizations + * hc + * apps + * triggers + * automations + * targets + * webhooks + * macros + * requests + * satisfaction_ratings + * dynamic_content + * any_channel (write only) + * web_widget (write only) + * security (read only) + * unrestricted (read and write) + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokenResponse' + examples: + default: + $ref: '#/components/examples/OAuthTokenResponseExample' + /api/v2/oauth/tokens/{oauth_token_id}: + parameters: + - $ref: '#/components/parameters/OAuthTokenId' + get: + operationId: ShowToken + tags: + - OAuth Tokens + summary: Show Token + description: | + Returns the properties of the specified token. For security reasons, only the first 10 characters of the access token are included. + + In the first endpoint, `id` is a token id, not the full token. + + In the second endpoint, include an `Authorization: Bearer` header with the full token to get its associated properties. Example: + + ```sh + curl https://{subdomain}.zendesk.com/api/v2/oauth/tokens/current \ + -H 'Authorization: Bearer ${authToken}' \ + -v -u {email_address}/token:{api_token} + ``` + + #### Allowed for + + * Admins, Agents, End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokenResponse' + examples: + default: + $ref: '#/components/examples/OAuthTokenResponseExample' + delete: + operationId: RevokeOAuthToken + tags: + - OAuth Tokens + summary: Revoke Token + description: | + #### Allowed for + * Admins, Agents, End Users + responses: + "204": + description: No content response + /api/v2/oauth/tokens/current: + get: + operationId: ShowCurrentToken + tags: + - OAuth Tokens + summary: Show Current Token + description: | + Returns the properties of the current token. Include an `Authorization: Bearer` header with the full token to get its associated properties. + + For security reasons, only the first 10 characters of the access token are included. + + #### Allowed for + + * Admins, Agents, End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokenResponse' + examples: + default: + $ref: '#/components/examples/OAuthTokenResponseExample' + delete: + operationId: RevokeCurrentOAuthToken + tags: + - OAuth Tokens + summary: Revoke Current Token + description: | + Revokes the current OAuth token. Include an `Authorization: Bearer` header with the full token. + + #### Allowed for + + * Admins, Agents, End Users + responses: + "204": + description: No content response + /api/v2/organization_fields: + get: + operationId: ListOrganizationFields + tags: + - Organization Fields + summary: List Organization Fields + description: | + Returns a list of custom organization fields in your account. Fields are returned in the order that you specify in your organization fields configuration in Zendesk Support. Clients should cache this resource for the duration of their API usage and map the key for each organization field to the values returned under the `organization_fields` attribute on the [organization](/api-reference/ticketing/organizations/organizations/) resource. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - name: resolve_dc + in: query + description: If true, resolves dynamic content placeholders. + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationFieldsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationFieldsResponseExample' + post: + operationId: CreateOrganizationField + tags: + - Organization Fields + summary: Create Organization Field + description: | + Creates any of the following custom field types: + + * text (default when no "type" is specified) + * textarea + * checkbox + * date + * integer + * decimal + * regexp + * dropdown + * lookup + * multiselect + + See [About custom field types](https://support.zendesk.com/hc/en-us/articles/203661866) in Zendesk help. + + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationFieldResponse' + examples: + default: + $ref: '#/components/examples/OrganizationFieldCreateResponseExample' + /api/v2/organization_fields/{organization_field_id}: + parameters: + - $ref: '#/components/parameters/OrganizationFieldId' + get: + operationId: ShowOrganizationField + tags: + - Organization Fields + summary: Show Organization Field + description: | + #### Allowed for + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationFieldResponse' + examples: + default: + $ref: '#/components/examples/OrganizationFieldResponseExample' + put: + operationId: UpdateOrganizationField + tags: + - Organization Fields + summary: Update Organization Field + description: | + #### Updating a Dropdown (Tagger) or Multiselect Field + + Dropdown and multiselect fields return an array of `custom_field_options` which specify the name, value, and order of dropdown or multiselect options. When updating a dropdown or multiselect field, note the following information: + + - All options must be passed on update. Options that are not passed will be removed. As a result, these values will be removed from any organizations + - To create a new option, pass a null `id` along with the `name` and `value` + - To update an existing option, pass its `id` along with the `name` and `value` + - To reorder an option, reposition it in the `custom_field_options` array relative to the other options + - To remove an option, omit it from the list of options upon update + + #### Example Request + + ```bash + curl https://{subdomain}.zendesk.com/api/v2/organization_fields/{organization_field_id} \ + -H "Content-Type: application/json" -X PUT \ + -d '{"organization_field": {"custom_field_options": [{"id": 124, "name": "Option 2", "value": "option_2"}, {"id": 123, "name": "Option 1", "value": "option_1"}, {"id": 125, "name": "Option 3", "value": "option_3"}]}}' \ + -v -u {email_address}/token:{api_token} + ``` + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationFieldResponse' + examples: + default: + $ref: '#/components/examples/OrganizationFieldUpdateResponseExample' + delete: + operationId: DeleteOrganizationField + tags: + - Organization Fields + summary: Delete Organization Field + description: | + #### Allowed for + + * Admins + responses: + "204": + description: No Content response + /api/v2/organization_fields/reorder: + put: + operationId: ReorderOrganizationField + tags: + - Organization Fields + summary: Reorder Organization Field + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/organization_memberships: + get: + operationId: ListOrganizationMemberships + tags: + - Organization Memberships + summary: List Memberships + description: | + Returns a list of organization memberships for the account, user or organization in question. + + **Note**: When returning organization memberships for a user, organization memberships are sorted with the default organization first, and then by organization name. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + - Agents + - End users + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/OrganizationMembershipsInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipsResponseExample' + post: + operationId: CreateOrganizationMembership + tags: + - Organization Memberships + summary: Create Membership + description: | + Assigns a user to a given organization. Returns an error with status 422 if the user is already assigned to the organization. + + #### Allowed For + + * Admins + * Agents when creating a new organization membership for an end user + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipCreateResponseExample' + /api/v2/organization_memberships/{organization_membership_id}: + parameters: + - $ref: '#/components/parameters/OrganizationMembershipId' + get: + operationId: ShowOrganizationMembershipById + tags: + - Organization Memberships + summary: Show Membership + description: | + #### Allowed for + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipResponseExample' + delete: + operationId: DeleteOrganizationMembership + tags: + - Organization Memberships + summary: Delete Membership + description: | + Immediately removes a user from an organization and schedules a job to unassign all working tickets currently assigned to the user and organization combination. The `organization_id` of the unassigned tickets is set to null. + + #### Allowed for + + * Admins + * Agents when deleting an organization membership for an end user + responses: + "204": + description: No Content response + /api/v2/organization_memberships/create_many: + post: + operationId: CreateManyOrganizationMemberships + tags: + - Organization Memberships + summary: Create Many Memberships + description: | + Accepts an array of up to 100 organization membership objects. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipCreateManyResponseExample' + /api/v2/organization_memberships/destroy_many: + delete: + operationId: DeleteManyOrganizationMemberships + tags: + - Organization Memberships + summary: Bulk Delete Memberships + description: | + Immediately removes a user from an organization and schedules a job to unassign all working tickets currently assigned to the user and organization combination. The `organization_id` of the unassigned tickets is set to null. + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Agents + parameters: + - name: ids + in: query + description: The IDs of the organization memberships to delete + schema: + type: array + items: + type: integer + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusBulkDeleteResponseExample' + /api/v2/organization_merges/{organization_merge_id}: + parameters: + - $ref: '#/components/parameters/OrganizationMergeId' + get: + operationId: ShowOrganizationMerge + tags: + - Organizations + summary: Show Organization Merge + description: | + Retrieves the details of a specific organization merge operation. This endpoint is useful for obtaining the status and outcome of a merge that was previously initiated. It provides information such as the winning and losing organization IDs, the status of the merge, and the associated URLs. + + This endpoint can be used to determine if a merge is still in progress, has completed successfully, or has encountered an error. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMergeResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMergeResponseExample' + /api/v2/organization_subscriptions: + get: + operationId: ListOrganizationSubscriptions + tags: + - Organization Subscriptions + summary: List Organization Subscriptions + description: |- + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + * End users + + For end users, the response will only list the subscriptions created by the requesting end user. + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionsResponseExample' + post: + operationId: CreateOrganizationSubscription + tags: + - Organization Subscriptions + summary: Create Organization Subscription + description: |- + #### Allowed For: + + * Agents + * End users + + End users can only subscribe to shared organizations in which they're members. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionCreateRequest' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionCreateRequestExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionResponse' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionResponseExample' + /api/v2/organization_subscriptions/{organization_subscription_id}: + get: + operationId: ShowOrganizationSubscription + tags: + - Organization Subscriptions + summary: Show Organization Subscription + description: |- + #### Allowed For: + + * Agents + * End users + + For end users, the response will only list the subscriptions created by the requesting end user. + parameters: + - $ref: '#/components/parameters/OrganizationSubscriptionId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionResponse' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionResponseExample' + delete: + operationId: DeleteOrganizationSubscription + tags: + - Organization Subscriptions + summary: Delete Organization Subscription + description: |- + #### Allowed For: + + * Agents + * End users + parameters: + - $ref: '#/components/parameters/OrganizationSubscriptionId' + responses: + "204": + description: No content + /api/v2/organizations: + get: + operationId: ListOrganizations + tags: + - Organizations + summary: List Organizations + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents, with certain restrictions + + If the agent has a custom agent role that restricts their access to only users in their own organization, a 403 Forbidden error is returned. See [Creating custom agent roles](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents#topic_cxn_hig_bd) in Zendesk help. + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationsResponseExample' + post: + operationId: CreateOrganization + tags: + - Organizations + summary: Create Organization + description: | + You must provide a unique `name` for each organization. Normally + the system doesn't allow records to be created with identical names. + However, a race condition can occur if you make two or more identical + POSTs very close to each other, causing the records to have identical + organization names. + + **Note**: Leading and trailing whitespace in `name` is automatically trimmed before validation. This means that names differing only by whitespace are treated as duplicates. For example, "API Company" and "API Company " are considered the same name. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage organizations (Enterprise only) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrganizationRequest' + examples: + default: + $ref: '#/components/examples/CreateOrganizationRequestExample' + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationResponse' + examples: + default: + $ref: '#/components/examples/CreatedOrganizationResponseExample' + /api/v2/organizations/{organization_id}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ShowOrganization + tags: + - Organizations + summary: Show Organization + description: | + #### Allowed For + + * Admins + * Agents + parameters: + - name: include + in: query + description: | + Include additional related data. Supported values: `lookup_relationship_fields`. + schema: + type: string + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationResponse' + examples: + default: + $ref: '#/components/examples/OrganizationResponseExample' + put: + operationId: UpdateOrganization + tags: + - Organizations + summary: Update Organization + description: | + #### Allowed For + + * Admins + * Agents + + Agents with no permissions restrictions can only update "notes" on organizations. + + **Note:** Updating an organization's `domain_names` property overwrites all existing `domain_names` values. To prevent this, submit a complete list of `domain_names` for the organization in your request. + + #### Example Request + + ```js + { + "organization": { + "notes": "Something interesting" + } + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationResponse' + examples: + default: + $ref: '#/components/examples/UpdateOrganizationResponseExample' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + examples: + default: + value: + errors: + - code: TooManyRequests + title: Too many requests to update + delete: + operationId: DeleteOrganization + tags: + - Organizations + summary: Delete Organization + description: | + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage organizations (Enterprise only) + responses: + "204": + description: No Content Response + /api/v2/organizations/{organization_id}/merge: + parameters: + - $ref: '#/components/parameters/OrganizationId' + post: + operationId: CreateOrganizationMerge + tags: + - Organizations + summary: Merge Organization With Another Organization + description: "Merges two organizations by moving all users, tickets, and domain names from the organization specified by `{organization_id}` to the organization specified by `winner_id`. After the merge:\n\n- The \"losing\" organization will be deleted.\n- Other organization fields and their values will not be carried over to the \"winning\" organization.\n- The merge operation creates an `Organization Merge` record which contains a status indicating the progress of the merge.\n\n**Note**: This operation is irreversible.\n\n#### Merge Statuses\n\n| Status | Description |\n|--------|-------------|\n| new | A job has been queued to merge the two organizations. |\n| in progress | The job to merge the two organizations has started. |\n| error | An error occurred during the merge job. The merge can be retried by repeating the API call. | \n| complete | The merge has been completed successfully. |\n\n#### Allowed For\n\n* Admins\n" + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMergeRequest' + examples: + default: + $ref: '#/components/examples/OrganizationMergeRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMergeResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMergeResponseExample' + /api/v2/organizations/{organization_id}/merges: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationMerges + tags: + - Organizations + summary: List Organization Merges + description: | + Retrieves a list of all organization merge operations associated with a given organization. This endpoint allows you to track the history of merge actions for an organization, including ongoing and completed merges. + + Each entry in the list contains details such as the ID of the merge, the winning and losing organization IDs, the current status of the merge, and a URL to access the `Organization Merge` record. + + #### Pagination + + - Cursor pagination is used for this endpoint. + - A maximum of 100 records can be returned per page. + + See [Pagination](/api-reference/introduction/pagination/) for more details. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMergeListResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMergeListResponseExample' + /api/v2/organizations/{organization_id}/organization_memberships: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationMembershipsByOrganization + tags: + - Organization Memberships + summary: List Organization Memberships by Organization + description: | + Returns a list of organization memberships for the account, user or organization in question. + + **Note**: When returning organization memberships for a user, organization memberships are sorted with the default organization first, and then by organization name. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + - Agents + - End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipsResponseExample' + /api/v2/organizations/{organization_id}/related: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: OrganizationRelated + tags: + - Organizations + summary: Show Organization's Related Information + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsRelatedResponse' + examples: + default: + $ref: '#/components/examples/OrganizationsRelatedResponse' + /api/v2/organizations/{organization_id}/requests: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationRequests + tags: + - Requests + summary: List Organization Requests + description: | + Returns a list of requests for a specific organization. + + #### Allowed for + + * End Users + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/organizations/{organization_id}/subscriptions: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationSubscriptionsByOrganization + tags: + - Organization Subscriptions + - Organizations + summary: List Subscriptions By Organization + description: |- + Returns a list of organization subscriptions for a specific organization. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + * End users + + For end users, the response will only list the subscriptions created by the requesting end user. + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionsResponseExample' + /api/v2/organizations/{organization_id}/tags: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationTags + tags: + - Tags + summary: List Organization Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + post: + operationId: SetOrganizationTags + tags: + - Tags + summary: Set Organization Tags + description: | + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + put: + operationId: AddOrganizationTags + tags: + - Tags + summary: Add Organization Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + delete: + operationId: RemoveOrganizationTags + tags: + - Tags + summary: Remove Organization Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsRemoveResponseExample' + /api/v2/organizations/{organization_id}/tickets: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationTickets + tags: + - Tickets + summary: List Organization Tickets + description: | + Returns a list of tickets for a specific organization. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Allowed For + + * Agents + responses: + "200": + description: List tickets + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/organizations/{organization_id}/tickets/count: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: CountOrganizationTickets + tags: + - Tickets + summary: Count Organization Tickets + description: | + Returns an approximate count of tickets for a specific organization. If the count exceeds 100,000, it is updated every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of tickets + content: + application/json: + schema: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + examples: + default: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + /api/v2/organizations/{organization_id}/users: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: ListOrganizationUsers + tags: + - Users + summary: List Organization Users + description: | + Returns a list of users for a specific organization. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + - $ref: '#/components/parameters/UserExternalIdFilter' + - $ref: '#/components/parameters/OrganizationUserSortBy' + - $ref: '#/components/parameters/OrganizationUserSortOrder' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/UsersResponseExample' + /api/v2/organizations/{organization_id}/users/count: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + operationId: CountOrganizationUsers + tags: + - Users + summary: Count Organization Users + description: | + Returns an approximate count of users for a specific organization. If the count exceeds 100,000, it is updated every 24 hours. + + The response includes a `refreshed_at` property in a `count` object that contains a timestamp indicating when the count was last updated. + + **Note**: When the count exceeds 100,000, the `refreshed_at` property may occasionally be null. + This indicates that the count is being updated in the background. The `count` object's `value` property is limited to 100,000 until the update is complete. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountResponse' + examples: + default: + $ref: '#/components/examples/UserCountResponseExample' + /api/v2/organizations/autocomplete: + get: + operationId: AutocompleteOrganizations + tags: + - Organizations + summary: Autocomplete Organizations + description: | + Returns an array of organizations whose name starts with the + value specified in the `name` parameter. + + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/OrganizationQueryFragment' + - $ref: '#/components/parameters/LookupRelationshipAutocompleteFieldIdFragment' + - $ref: '#/components/parameters/LookupRelationshipAutocompleteSourceFragment' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + examples: + default: + $ref: '#/components/examples/AutocompleteOrganizationsResponseExample' + "400": + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + examples: + default: + value: + errors: + - code: QueryError + title: Invalid type:sample_type + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + examples: + default: + value: + errors: + - code: TooManyRequests + title: Too many requests to autocomplete + /api/v2/organizations/count: + get: + operationId: CountOrganizations + tags: + - Organizations + summary: Count Organizations + description: | + Returns an approximate count of organizations. If the count exceeds + 100,000, it is updated every 24 hours. + + The `refreshed_at` property of the `count` object is a timestamp that indicates + when the count was last updated. + + When the count exceeds 100,000, the `refreshed_at` property may + occasionally be null. This indicates that the count is being + updated in the background and the `value` property of the `count` object is limited to + 100,000 until the update is complete. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountOrganizationResponse' + examples: + default: + $ref: '#/components/examples/CountOrganizationsResponseExample' + /api/v2/organizations/create_many: + post: + operationId: CreateManyOrganizations + tags: + - Organizations + summary: Create Many Organizations + description: | + Accepts an array of up to 100 organization objects. + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Agents, with restrictions applying on certain actions + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ShowJobStatusResponseExample' + /api/v2/organizations/create_or_update: + post: + operationId: CreateOrUpdateOrganization + tags: + - Organizations + summary: Create Or Update Organization + description: | + Creates an organization if it doesn't already exist, or updates + an existing organization. Using this method means one less call + to check if an organization exists before creating it. You need + to specify the id or external id when updating + an organization to avoid a duplicate error response. Name is + not available as a matching criteria. + + #### Allowed For + + * Agents, with restrictions on certain actions + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationResponse' + examples: + default: + $ref: '#/components/examples/CreatedOrganizationResponseExample' + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationResponse' + examples: + default: + $ref: '#/components/examples/CreatedOrganizationResponseExample' + /api/v2/organizations/destroy_many: + parameters: + - $ref: '#/components/parameters/OrganizationIds' + - $ref: '#/components/parameters/OrganizationExternalIds' + delete: + operationId: DeleteManyOrganizations + tags: + - Organizations + summary: Bulk Delete Organizations + description: | + Accepts a comma-separated list of up to 100 organization ids or external ids. + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage organizations (Enterprise only) + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusBulkDeleteResponseExample' + /api/v2/organizations/search: + parameters: + - $ref: '#/components/parameters/OrganizationExternalId' + - $ref: '#/components/parameters/OrganizationName' + get: + operationId: SearchOrganizations + tags: + - Organizations + summary: Search Organizations + description: | + Returns an array of organizations matching the criteria. You may search by an organization's `external_id` or `name`, but not both: + + #### Searching by `external_id` + + If you set the `external_id` value of an organization to associate it to an external record, you can use it to search for the organization. + + For an organization to be returned, its `external_id` must exactly match the value provided (case insensitive). + + #### Searching by `name` + + For an organization to be returned, its `name` must exactly match the value provided (case insensitive). + + #### Allowed For: + + * Admins + * Agents assigned to a custom role with permissions to add or modify organizations (Enterprise only) + + See [Creating custom agent roles](https://support.zendesk.com/hc/en-us/articles/203662026#topic_cxn_hig_bd) in the Support Help Center. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationsResponseExample' + /api/v2/organizations/show_many: + parameters: + - $ref: '#/components/parameters/OrganizationIds' + - $ref: '#/components/parameters/OrganizationExternalIds' + get: + operationId: ShowManyOrganizations + tags: + - Organizations + summary: Show Many Organizations + description: | + Accepts a comma-separated list of up to 100 organization ids or external ids. + + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + examples: + default: + $ref: '#/components/examples/AutocompleteOrganizationsResponseExample' + /api/v2/organizations/update_many: + parameters: + - $ref: '#/components/parameters/OrganizationIds' + - $ref: '#/components/parameters/OrganizationExternalIds' + put: + operationId: UpdateManyOrganizations + tags: + - Organizations + summary: Update Many Organizations + description: | + Bulk or batch updates up to 100 organizations. + + #### Bulk update + + To make the same change to multiple organizations, use the following endpoint and data format: + + `https://{subdomain}.zendesk.com/api/v2/organizations/update_many?ids=1,2,3` + + ```js + { + "organization": { + "notes": "Priority" + } + } + ``` + + #### Batch update + + To make different changes to multiple organizations, use the following endpoint and data format: + + `https://{subdomain}.zendesk.com/api/v2/organizations/update_many` + + ```js + { + "organizations": [ + { "id": 1, "notes": "Priority" }, + { "id": 2, "notes": "Normal" } + ] + } + ``` + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Admins + * Agents + + Agents with no permissions restrictions can only update "notes" on organizations. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ShowJobStatusResponseExample' + /api/v2/problems: + get: + operationId: ListTicketProblems + tags: + - Tickets + summary: List Ticket Problems + description: |- + The response is always ordered by `updated_at` in descending order + + #### Allowed For + + * Agents + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketProblemsResponse' + examples: + default: + $ref: '#/components/examples/ListTicketProblemsResponseExample' + /api/v2/problems/autocomplete: + post: + operationId: AutocompleteProblems + tags: + - Tickets + summary: Autocomplete Problems + description: |- + Returns tickets whose type is "problem" and whose subject contains the string specified in the `text` parameter. + + You can specify the `text` parameter in the request body rather than the query string. Example: + + `{"text": "fire"}` + + #### Allowed For + + * Agents + parameters: + - name: text + in: query + description: The text to search for + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The text to search for + example: + text: fire + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketProblemsResponse' + examples: + default: + $ref: '#/components/examples/ListTicketProblemsResponseExample' + /api/v2/push_notification_devices/destroy_many: + post: + operationId: PushNotificationDevices + tags: + - Push Notification Devices + summary: Bulk Unregister Push Notification Devices + description: |- + Unregisters the mobile devices that are receiving push notifications. Specify the devices as an array of mobile device tokens. + + #### Allowed for + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PushNotificationDevicesRequest' + examples: + default: + $ref: '#/components/examples/PushNotificationDevicesRequestExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: string + description: empty + example: "" + example: "" + /api/v2/queues: + get: + operationId: ListQueues + tags: + - Omnichannel Routing Queues + summary: List queues + description: | + Returns all active queues for an account. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/QueuesResponse' + examples: + default: + $ref: '#/components/examples/QueuesResponseExample' + post: + operationId: CreateQueue + tags: + - Omnichannel Routing Queues + summary: Create Queue + description: | + Creates a queue. Accepts a JSON queue definition as the request body. + + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/QueueResponse' + examples: + default: + $ref: '#/components/examples/QueueCreateResponseExample' + /api/v2/queues/{queue_id}: + parameters: + - $ref: '#/components/parameters/OcrQueueId' + get: + operationId: ShowQueueById + tags: + - Omnichannel Routing Queues + summary: Show Queue + description: | + Returns a queue for the given queue id. + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/QueueResponse' + examples: + default: + $ref: '#/components/examples/QueueResponseExample' + put: + operationId: UpdateQueue + tags: + - Omnichannel Routing Queues + summary: Update Queue + description: | + Updates the queue definition for a given queue id. + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/QueueResponse' + examples: + default: + $ref: '#/components/examples/QueuesUpdateResponseExample' + delete: + operationId: DeleteQueue + tags: + - Omnichannel Routing Queues + summary: Delete Queue + description: | + Deletes the queue and related records. + #### Allowed For + + * Admins + responses: + "204": + description: No content response + /api/v2/queues/definitions: + get: + operationId: ListQueueDefinitions + tags: + - Omnichannel Routing Queues + summary: List Queue Definitions + description: | + Returns the definitions of the queues and the + definitions of the conditions under which a queue can execute. The + definition of the action includes a title ("Status"), a type ("list"), and + possible values. The definition of the condition includes the same fields + as well as the possible operators. + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/DefinitionsResponse' + examples: + default: + $ref: '#/components/examples/DefinitionsResponseExample' + /api/v2/queues/order: + patch: + operationId: ReorderQueues + tags: + - Omnichannel Routing Queues + summary: Reorder Queues + description: | + Alters the evaluation order of OCR queues in the account. + The evaluation order is set in a `queue_ids` array in the request body. + + You must include every queue id in your account to reorder the OCR queues. If not, the endpoint will return 400 Bad Request. + + #### Allowed For + + * Admins + responses: + "204": + description: No Content + /api/v2/recipient_addresses: + get: + operationId: ListSupportAddresses + tags: + - Support Addresses + summary: List Support Addresses + description: | + Lists all the support addresses for the account. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeSideloads' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SupportAddressesResponse' + examples: + default: + $ref: '#/components/examples/SupportAddressesResponseExample' + post: + operationId: CreateSupportAddress + tags: + - Support Addresses + summary: Create Support Address + description: | + Adds a Zendesk or external support address to your account. + + To add a Zendesk address, use the following syntax: `{local-part}@{accountname}.zendesk.com`. + Example: 'sales-team@example.zendesk.com'. The [local-part](https://en.wikipedia.org/wiki/Email_address#Local-part) can be anything you like. + + To add an external email address such as help@omniwearshop.com, the email must already exist and you must set up forwarding on your email server. The exact steps depend on your mail server. See [Forwarding incoming email to Zendesk Support](https://support.zendesk.com/hc/en-us/articles/203663266). After setting up forwarding, run the [Verify Support Address Forwarding](#verify-support-address-forwarding) endpoint. The address won't work in Zendesk Support until it's been verified. + + #### Allowed For + + * Admins + * Agents with permission to manage channels and extensions. See the system permissions in [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents-Enterprise-#topic_cxn_hig_bd) in the Support Help Center + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/SupportAddressResponse' + examples: + default: + $ref: '#/components/examples/SupportAddressCreateResponseExample' + /api/v2/recipient_addresses/{support_address_id}: + parameters: + - $ref: '#/components/parameters/SupportAddressId' + get: + operationId: ShowSupportAddress + tags: + - Support Addresses + summary: Show Support Address + description: | + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SupportAddressResponse' + examples: + default: + $ref: '#/components/examples/SupportAddressResponseExample' + put: + operationId: UpdateSupportAddress + tags: + - Support Addresses + summary: Update Support Address + description: | + Updates an existing support address for your account. + + You can't use this endpoint to update a support address's `email` property. + Instead, you can create a new address using the [Create Support + Address](#create-support-address) endpoint. + + #### Allowed For + + * Admins + * Agents with permission to manage channels and extensions. See the system permissions in [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents-Enterprise-#topic_cxn_hig_bd) in the Support Help Center + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SupportAddressResponse' + examples: + default: + $ref: '#/components/examples/SupportAddressUpdateResponseExample' + delete: + operationId: DeleteRecipientAddress + tags: + - Support Addresses + summary: Delete Support Address + description: | + Deletes a support address. + + #### Allowed For + + * Admins + * Agents with permission to manage channels and extensions. See the system permissions in [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents-Enterprise-#topic_cxn_hig_bd) in the Support Help Center + responses: + "204": + description: No Content response + /api/v2/recipient_addresses/{support_address_id}/verify: + parameters: + - $ref: '#/components/parameters/SupportAddressId' + put: + operationId: VerifySupportAddressForwarding + tags: + - Support Addresses + summary: Verify Support Address Forwarding + description: | + Sends a test email to the specified support address to verify that email forwarding for the address works. An external support address won't work in Zendesk Support until it's verified. + + **Note**: You don't need to verify Zendesk system support addresses. + + The endpoint takes the following body: `{"type": "forwarding"}`. The value of the `type` property defaults to "forwarding" if none is specified, but the values "spf" and "dns" are also accepted. + + Use this endpoint after [adding](#create-support-address) an external support address to Zendesk Support and setting up forwarding on your email server. See [Forwarding incoming email to Zendesk Support](https://support.zendesk.com/hc/en-us/articles/203663266). + + The endpoint doesn't return the results of the test. Instead, use the [Show Support Address](#show-support-address) endpoint to check that the `forwarding_status` property is "verified". + + Other verification checks can also be performed using this API. These include SPF checks and DNS checks. + + When calling the endpoint with `type` set to "spf", it will queries the DNS records to check that the SPF records for Zendesk are present for outbound emails. + + When calling the endpoint with `type` set to "dns", it runs checks on your CNAME records to make sure they are set up properly in your DNS. + + #### Allowed For + + * Admins + * Agents with permission to manage channels and extensions. See the system permissions in [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents-Enterprise-#topic_cxn_hig_bd) in the Support Help Center + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/relationships/definitions/{target_type}: + get: + operationId: GetRelationshipFilterDefinitions + tags: + - Lookup Relationships + summary: Filter Definitions + description: | + Returns filter definitions based on the given target type. Target types + include users (zen:user), tickets (zen:ticket), organizations (zen:organization), or custom objects (zen:custom_object:CUSTOM_OBJECT_KEY). + The returned filter definitions are the options that you can use to build a custom field or ticket field's + `relationship_filter`. + parameters: + - name: target_type + in: path + description: | + The target type for which you would like to see filter definitions. + The options are "zen:user", "zen:ticket", "zen:organization", and "zen:custom_object:CUSTOM_OBJECT_KEY" + required: true + schema: + type: string + example: zen:custom_object:apartment + - name: source_type + in: query + description: | + The source type for which you would like to see filter definitions. + The options are "zen:user", "zen:ticket", and "zen:organization" + schema: + type: string + example: zen:user + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipFilterDefinitionResponse' + examples: + default: + $ref: '#/components/examples/RelationshipFilterDefinitionExample' + /api/v2/remote_authentications: + get: + operationId: ListRemoteAuthentications + tags: + - Remote Authentications + summary: List Remote Authentications + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RemoteAuthenticationsResponse' + examples: + default: + $ref: '#/components/examples/RemoteAuthenticationsResponseExample' + /api/v2/requests: + get: + operationId: ListRequests + tags: + - Requests + summary: List Requests + description: "#### Allowed for\n\n* End Users\n\n#### Pagination\n\n* Cursor pagination (recommended)\n* Offset pagination\n\nSee [Pagination](/api-reference/introduction/pagination/).\n\n#### High volume requests\n\nRequesting a large number of tickets may return intermittent \"503 Service Unavailable\" errors. Workarounds:\n\n- Use cursor pagination with a smaller page size. Example: GET /api/v2/requests?page[size]=100. If you continue to see timeouts, try a smaller value, such as 50 or 25. \n- Use [Search Requests](/api-reference/ticketing/tickets/ticket-requests/#search-requests) instead. \n" + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + post: + operationId: CreateRequest + tags: + - Requests + summary: Create Request + description: | + Accepts a `request` object that sets one or more properties. + + #### Allowed for + + * End users + * Anonymous users (rate limit of 5 requests per hour for [trial accounts](/documentation/developer-tools/getting-started/getting-a-trial-or-sponsored-account-for-development/)) + + #### Additional properties + + In addition to the writable request properties in the [JSON Format table](#json-format) above, you can set the following properties when creating a request. + + | Name | Type | Mandatory | Comment + | ---------------- | -------| --------- | ------- + | comment | object | yes | Describes the problem, incident, question, or task. See [Request comments](#request-comments) + | collaborators | array | no | Adds collaborators (cc's) to the request. An email notification is sent to them when the ticket is created. See [Setting collaborators](/documentation/ticketing/managing-tickets/creating-and-managing-requests#setting-collaborators) + | requester | object | yes* | \*Required for anonymous requests. Specifies the requester of the anonymous request. See [Creating anonymous requests](/documentation/ticketing/managing-tickets/creating-and-managing-requests#creating-anonymous-requests) + + #### Creating follow-up requests + + Once a ticket is closed (as distinct from solved), it can't be reopened. However, you can create a new request that references the closed ticket. To create the follow-up request, include a `via_followup_source_id` property in the `request` object that specifies the closed ticket. The parameter only works with closed tickets. It has no effect with other tickets. + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestResponse' + examples: + default: + $ref: '#/components/examples/RequestCreateResponseExample' + /api/v2/requests/{request_id}: + parameters: + - $ref: '#/components/parameters/RequestId' + get: + operationId: ShowRequest + tags: + - Requests + summary: Show Request + description: | + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | users | The email ccs for a request by side-loading users + + #### Allowed For + + * End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestResponse' + examples: + default: + $ref: '#/components/examples/RequestResponseExample' + put: + operationId: UpdateRequest + tags: + - Requests + summary: Update Request + description: | + Updates a request with a comment or collaborators (cc's). The end user who created the request can also use it to mark the request as solved. The endpoint can't be used to update other request attributes. + + #### Writable properties + This endpoint can only update the following properties in the request. + + | Name | Type | Required | Description | + | ------------------------ | ------- | -------- | ---------------------------------------------------- | + | comment | object | no | Adds a comment to the request. See [Request comments](#request-comments) | + | solved | boolean | no | Marks the request as solved. Example: `{"request": {"solved": "true"}}`. End users can mark requests as solved only if the request's `can_be_solved_by_me` property is true. The property is true only when the ticket is assigned to an agent and the ticket type is not a problem but a question, task, or incident | + | additional_collaborators | array | no | Adds collaborators to the request. An email notification is sent to them when the ticket is updated. See [Adding collaborators](/documentation/ticketing/managing-tickets/creating-and-managing-requests#adding-collaborators) | + + #### Allowed For + + * End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestResponse' + examples: + default: + $ref: '#/components/examples/RequestCreateResponseExample' + /api/v2/requests/{request_id}/comments: + parameters: + - $ref: '#/components/parameters/RequestId' + get: + operationId: ListComments + tags: + - Requests + summary: Listing Comments + description: | + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Sorting + + By default, comments are sorted by creation date in ascending order. + + When using cursor pagination, use the following parameter to change the sort order: + + | Name | Type | Required | Comments + | ------ | ------ | -------- | -------- + | `sort` | string | no | Possible values are "created_at" (ascending order) or "-created_at" (descending order) + + When using offset pagination, use the following parameters to change the sort order: + + | Name | Type | Required | Comments + | ------------ | ------ | -------- | -------- + | `sort_by` | string | no | One of `created_at`, `updated_at` + | `sort_order` | string | no | One of `asc`, `desc` + + #### Allowed For + + * End Users + parameters: + - name: since + in: query + description: Filters the comments from the given datetime + schema: + type: string + - name: role + in: query + description: One of "agent", "end_user". If not specified it does not filter + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentsResponse' + examples: + default: + $ref: '#/components/examples/RequestListCommentsResponseExample' + /api/v2/requests/{request_id}/comments/{ticket_comment_id}: + parameters: + - $ref: '#/components/parameters/RequestId' + - $ref: '#/components/parameters/TicketCommentId' + get: + operationId: ShowComment + tags: + - Requests + summary: Getting Comments + description: | + #### Allowed For + + * End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentResponse' + examples: + default: + $ref: '#/components/examples/RequestGetCommentResponseExample' + /api/v2/requests/ccd: + get: + operationId: ListCCDRequests + tags: + - Requests + summary: List CCD Requests + description: | + Lists requests where the authenticated end user is CC'd. + + #### Allowed for + + * End Users + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/requests/open: + get: + operationId: ListOpenRequests + tags: + - Requests + summary: List Open Requests + description: | + Lists requests with the "open" status for the authenticated end user. + + #### Allowed for + + * End Users + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/requests/search: + get: + operationId: SearchRequests + tags: + - Requests + summary: Search Requests + description: | + Examples: + + * `GET /api/v2/requests/search?query=printer` + * `GET /api/v2/requests/search?query=printer&organization_id=1` + * `GET /api/v2/requests/search?query=printer&cc_id=true` + * `GET /api/v2/requests/search?query=printer&status=hold,open` + + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Results limit + + The Search Requests endpoint returns up to 1,000 results per query, with a maximum of 100 results per page. See [Pagination](/api-reference/ticketing/introduction/#pagination). If you request a page past the limit (`page=11` at 100 results per page), a 422 Insufficient Resource Error is returned. + + #### Allowed For + + * End Users + parameters: + - name: query + in: query + description: The syntax and matching logic for the string is detailed in the [Zendesk Support search reference](https://support.zendesk.com/hc/en-us/articles/203663226). See also [Query basics](/api-reference/ticketing/ticket-management/search/#query-basics) in the Tickets API doc. + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/requests/solved: + get: + operationId: ListSolvedRequests + tags: + - Requests + summary: List Solved Requests + description: | + Lists requests with the "solved" status for the authenticated end user. + + #### Allowed for + + * End Users + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/resource_collections: + get: + operationId: ListResourceCollections + tags: + - Resource Collections + summary: List Resource Collections + description: | + Lists resource collections for the account. + + #### Allowed for + + * Admins + parameters: + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceCollectionsResponse' + examples: + default: + $ref: '#/components/examples/ResourceCollectionsResponseExample' + post: + operationId: CreateResourceCollection + tags: + - Resource Collections + summary: Create Resource Collection + description: | + Creates a resource collection from a provided `payload` object. The `payload` object is specified the same way as the content of a requirements.json file in a Zendesk app. See [Specifying Apps Requirements](/documentation/apps/app-developer-guide/apps_requirements/) in the Zendesk Apps framework docs. + + The response includes a [job + status](/api-reference/ticketing/ticket-management/job_statuses/) for creation of the specified resources. + + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ResourceCollectionCreateResponseExample' + /api/v2/resource_collections/{resource_collection_id}: + parameters: + - $ref: '#/components/parameters/ResourceCollectionId' + get: + operationId: RetrieveResourceCollection + tags: + - Resource Collections + summary: Show Resource Collection + description: | + Retrieves details for a specified resource collection. + + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceCollectionResponse' + examples: + default: + $ref: '#/components/examples/ResourceCollectionResponseExample' + put: + operationId: UpdateResourceCollection + tags: + - Resource Collections + summary: Update Resource Collection + description: | + Updates a resource collection using a provided `payload` object. The `payload` object is specified the same way as the content of a requirements.json file in a Zendesk app. See [Specifying Apps Requirements](/documentation/apps/app-developer-guide/apps_requirements/) in the Zendesk Apps framework docs. + + The response includes a [job + status](/api-reference/ticketing/ticket-management/job_statuses/) for the resource updates. + + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ResourceCollectionUpdateResponseExample' + delete: + operationId: DeleteResourceCollection + tags: + - Resource Collections + summary: Delete Resource Collection + description: | + Deletes a specified resource collection. + + The response includes a [job + status](/api-reference/ticketing/ticket-management/job_statuses/) for deletion of the collection's resources. + + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/ResourceCollectionDeleteResponseExample' + /api/v2/routing/agents/{user_id}/instance_values: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListAGentAttributeValues + tags: + - Skill Based Routing + summary: List Agent Attribute Values + description: | + Returns an attribute value. + + #### Allowed For + + * Agents and admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValuesResponseExample' + post: + operationId: SetAgentAttributeValues + tags: + - Skill Based Routing + summary: Set Agent Attribute Values + description: | + Adds the specified attributes if no attributes exists, or replaces all existing attributes with the specified attributes. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesWithoutPriorityResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValuesWithoutPriorityResponseExample' + /api/v2/routing/agents/instance_values: + get: + operationId: ListManyAgentsAttributeValues + tags: + - Skill Based Routing + summary: List Attribute Values for Many Agents + description: | + Accepts a comma-separated list of up to 100 agent ids and returns attribute values for each agent in the list. + + #### Allowed For + * Admins + * [Agents in custom role with permission to manage skills](https://support.zendesk.com/hc/en-us/articles/4408882153882-Creating-custom-roles-and-assigning-agents) + + #### Pagination + * [Cursor pagination](/api-reference/introduction/pagination/#cursor-pagination) only. + Note: `page[before]` and `page[after]` can't be used together in the same request. + parameters: + - name: filter[agent_ids] + in: query + description: A comma-separated list of agent ids + required: true + schema: + type: string + example: 224,225 + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. + schema: + type: string + - name: page[size] + in: query + description: The number of items to return per page + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ManySkillBasedRoutingAttributeValuesResponse' + examples: + default: + $ref: '#/components/examples/ManySkillBasedRoutingAttributeValuesResponseExample' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesError' + examples: + default: + $ref: '#/components/examples/ManySkillBasedRoutingAttributeValuesErrorExample' + /api/v2/routing/agents/instance_values/jobs: + post: + operationId: BulkSetAgentAttributeValuesJob + tags: + - Skill Based Routing + - Job Statuses + summary: Bulk Set Agent Attribute Values Jobs + description: | + Adds, replaces or removes multiple attributes for up to 100 agents. + + #### Allowed For + * Admins + * [Agents in custom role with permission to manage skills](https://support.zendesk.com/hc/en-us/articles/4408882153882-Creating-custom-roles-and-assigning-agents) + + #### Available Parameters + + The request takes a data object with the following properties: + | Name | Type | Required | Description | + | ---------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | action | string | true | The action to perform on the attribute values. One of the following: "upsert", "update", "delete" | + | attributes | object | true | The attribute values to update. See [Attribute Values](#attribute-values). `agent_skill_priority` is optional. If not provided, it keeps the current priority or defaults to `NORMAL` when adding new attribute values. | + | items | array | true | The list of agent ids | + + Action can be one of the following: + * upsert: Adds new attribute values to the agents + * update: Replaces all the current attribute values of the agents with the new values + * delete: Removes specified attribute values from the agents + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BulkSkillBasedRoutingAttributeValuesRequest' + examples: + default: + $ref: '#/components/examples/BulkSkillBasedRoutingAttributeValuesRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/BulkSkillBasedRoutingAttributeValuesJobStatusResponseExample' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesError' + examples: + default: + $ref: '#/components/examples/BulkSkillBasedRoutingAttributeValuesErrorExample' + /api/v2/routing/attributes: + get: + operationId: ListAccountAttributes + tags: + - Skill Based Routing + summary: List Account Attributes + description: | + Returns a list of attributes for the account. + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | attribute_values | The attribute values available on the account + + #### Allowed For + + * Agents and admins + parameters: + - $ref: '#/components/parameters/RoutingAttributesInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributesResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributesResponseExample' + post: + operationId: CreateAttribute + tags: + - Skill Based Routing + summary: Create Attribute + description: | + Creates an attribute. + + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeCreateResponseExample' + /api/v2/routing/attributes/{attribute_id}: + parameters: + - $ref: '#/components/parameters/SkillBasedRoutingAttributeId' + get: + operationId: ShowAttribute + tags: + - Skill Based Routing + summary: Show Attribute + description: | + Returns an attribute. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeResponseExample' + put: + operationId: UpdateAttribute + tags: + - Skill Based Routing + summary: Update Attribute + description: | + Updates an attribute. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeUpdateResponseExample' + delete: + operationId: DeleteAttribute + tags: + - Skill Based Routing + summary: Delete Attribute + description: | + Deletes an attribute. + + #### Allowed For + + * Admins + responses: + "204": + description: No Content response + /api/v2/routing/attributes/{attribute_id}/values: + parameters: + - $ref: '#/components/parameters/SkillBasedRoutingAttributeId' + get: + operationId: ListAttributeValues + tags: + - Skill Based Routing + summary: List Attribute Values for an Attribute + description: | + Returns a list of attribute values for a provided attribute. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesWithoutPriorityResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValuesWithoutPriorityResponseExample' + post: + operationId: CreateAttributeValue + tags: + - Skill Based Routing + summary: Create Attribute Value + description: | + Creates an attribute value. + + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValueCreateResponseExample' + /api/v2/routing/attributes/{attribute_id}/values/{attribute_value_id}: + parameters: + - $ref: '#/components/parameters/SkillBasedRoutingAttributeId' + - $ref: '#/components/parameters/SkillBasedRoutingAttributeValueId' + get: + operationId: ShowAttributeValue + tags: + - Skill Based Routing + summary: Show Attribute Value + description: | + Returns an attribute value. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValueResponseExample' + patch: + operationId: UpdateAttributeValue + tags: + - Skill Based Routing + summary: Update Attribute Value + description: | + Updates the name and ticket conditions of a skill. When a ticket is created, the skill is applied to a ticket if the ticket meets the specified condition or conditions. See the [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference/) for more information. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeValueUpdateResponseExample' + delete: + operationId: DeleteAttributeValue + tags: + - Skill Based Routing + summary: Delete Attribute Value + description: | + Deletes an attribute value. + + #### Allowed For + + * Agents + responses: + "204": + description: No Content response + /api/v2/routing/attributes/definitions: + get: + operationId: ListRoutingAttributeDefinitions + tags: + - Skill Based Routing + summary: List Routing Attribute Definitions + description: | + Returns the condition definitions that can be configured to apply attributes to a ticket. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeDefinitions' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingAttributeDefinitionsExample' + /api/v2/routing/requirements/fulfilled: + get: + operationId: ListTicketsFullfilledByUser + tags: + - Skill Based Routing + summary: List Tickets Fulfilled by a User + description: | + Returns a list of ticket ids that contain attributes matching the current user's attributes. Accepts a `ticket_ids` parameter for relevant tickets to check for matching attributes. + + #### Allowed For + + * Agents and admins + parameters: + - name: ticket_ids + in: query + description: The IDs of the relevant tickets to check for matching attributes + required: true + schema: + type: integer + example: 1 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingTicketFulfilledResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingTicketFulfilledResponseExample' + /api/v2/routing/tickets/{ticket_id}/instance_values: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ListTicketAttributeValues + tags: + - Skill Based Routing + summary: List Ticket Attribute Values + description: | + Returns a list of attributes values for the ticket. + + #### Allowed For + + * Agents and admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingTicketAttributesResponseExample' + post: + operationId: SetTicketAttributeValues + tags: + - Skill Based Routing + summary: Set Ticket Attribute Values + description: | + Adds the specified attributes if no attributes exists, or replaces all existing attributes with the specified attributes. + + Invalid or deleted attributes are ignored. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValuesResponse' + examples: + default: + $ref: '#/components/examples/SkillBasedRoutingTicketAttributesResponseExample' + /api/v2/satisfaction_ratings: + get: + operationId: ListSatisfactionRatings + tags: + - Satisfaction Ratings + summary: List Satisfaction Ratings + description: | + #### Allowed For + * Admins + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Filters + + | Parameter | Value + | ---------- | ----- + | score | offered, unoffered, received, received\_with\_comment, received\_without\_comment,
good, good\_with\_comment, good\_without\_comment,
bad, bad\_with\_comment, bad\_without\_comment + | start_time | Time of the oldest satisfaction rating, as a [Unix epoch time](https://www.epochconverter.com/) + | end_time | Time of the most recent satisfaction rating, as a [Unix epoch time](https://www.epochconverter.com/) + + If you specify an unqualified score such as `good`, the results include all the records with and without comments. + + Examples: + + * `/api/v2/satisfaction_ratings?score=bad` + * `/api/v2/satisfaction_ratings?score=bad&start_time=1498151194` + * `/api/v2/satisfaction_ratings?start_time=1340384793&end_time=1371920793` + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionRatingsResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionRatingsResponseExample' + /api/v2/satisfaction_ratings/{satisfaction_rating_id}: + get: + operationId: ShowSatisfactionRating + tags: + - Satisfaction Ratings + summary: Show Satisfaction Rating + description: | + Returns a specific satisfaction rating. You can get the id from + the [List Satisfaction Ratings](#list-satisfaction-ratings) endpoint. + + #### Allowed For + + * Admins + parameters: + - name: satisfaction_rating_id + in: path + description: The id of the satisfaction rating to retrieve + required: true + schema: + type: integer + example: 35436 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionRatingResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionRatingResponseExample' + /api/v2/satisfaction_ratings/count: + get: + operationId: CountSatisfactionRatings + tags: + - Satisfaction Ratings + summary: Count Satisfaction Ratings + description: |- + Returns an approximate count of satisfaction ratings in the account. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Admins + responses: + "200": + description: Count of satisfaction ratings + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionRatingsCountResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionRatingsCountResponseExample' + /api/v2/satisfaction_reasons: + get: + operationId: ListSatisfactionRatingReasons + tags: + - Satisfaction Reasons + summary: List Reasons for Satisfaction Rating + description: | + List all reasons for an account + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionReasonsResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionReasonsResponseExample' + /api/v2/satisfaction_reasons/{satisfaction_reason_id}: + get: + operationId: ShowSatisfactionRatings + tags: + - Satisfaction Reasons + summary: Show Reason for Satisfaction Rating + description: | + #### Allowed For + + * Admins + parameters: + - name: satisfaction_reason_id + in: path + description: The id of the satisfaction rating reason + required: true + schema: + type: integer + example: 35121 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionReasonResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionReasonResponseExample' + /api/v2/search: + get: + operationId: ListSearchResults + tags: + - Search + summary: List Search Results + description: | + Returns the search results. See [Query syntax](#query-syntax) for details on the `query` parameter. + + Use the ampersand character (&) to append the `sort_by` or `sort_order` parameters to the URL. + + For examples, see [Searching with Zendesk API](/documentation/ticketing/using-the-zendesk-api/searching-with-the-zendesk-api). + + This endpoint has its own rate limit. The rate limit counts towards the global API rate limit. See [Limits](#limits). + + #### Allowed For + + * Agents + + #### Pagination + + * Offset pagination only + + Offset pagination may result in duplicate results when paging. You can also use the + [Export Search Results](/api-reference/ticketing/ticket-management/search/#export-search-results) endpoint, which + uses cursor-based pagination and doesn't return duplicate results. See + [Using cursor pagination](/api-reference/introduction/pagination/#using-cursor-pagination) for more information. + + + #### Errors JSON Format + + Errors are represented as JSON objects which have the following keys: + + | Name | Type | Comment + | --------------------- | ---------------------| -------------------- + | error | string | The type of error. Examples: "unavailable", "invalid" + | description | string | + + ##### Example Error + ```js + { + "error": "unavailable", + "description": "Sorry, we could not complete your search query. Please try again in a moment." + } + ``` + parameters: + - name: query + in: query + description: The search query. See [Query basics](#query-basics) above. For details on the query syntax, see the [Zendesk Support search reference](https://support.zendesk.com/hc/en-us/articles/203663226) + required: true + schema: + type: string + example: https://subdomain.zendesk.com/api/v2/search?query=type:ticket status:closed&sort_by=status&sort_order=desc + - name: sort_by + in: query + description: One of `updated_at`, `created_at`, `priority`, `status`, or `ticket_type`. Defaults to sorting by relevance + schema: + type: string + - name: sort_order + in: query + description: One of `asc` or `desc`. Defaults to `desc` + schema: + type: string + - $ref: '#/components/parameters/SearchInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResponse' + examples: + default: + $ref: '#/components/examples/SearchResponseExample' + /api/v2/search/count: + get: + operationId: CountSearchResults + tags: + - Search + summary: Show Results Count + description: | + Returns the number of items matching the query rather than the items. The search string works the same as a regular search. + + #### Allowed For + + - Agents + parameters: + - name: query + in: query + description: The search query + required: true + schema: + type: string + example: https://subdomain.zendesk.com/api/v2/search?query=type:ticket status:closed + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SearchCountResponse' + examples: + default: + $ref: '#/components/examples/SearchCountResponseExample' + /api/v2/search/export: + get: + operationId: ExportSearchResults + tags: + - Search + summary: Export Search Results + description: | + Exports a set of results. See [Query syntax](#query-syntax) for the syntax of the `query` parameter. + + Use this endpoint for search queries that will return more than 1000 results. The result set is ordered only by the `created_at` attribute. + + The search only returns results of a single object type. The following object types are supported: ticket, organization, user, or group. + + You must specify the type in the `filter[type]` parameter. Searches with type in the query string will result in an error. + + #### Allowed For + + - Agents + + #### Pagination + + - Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 1000 records per page. The number of results shown in a page is determined by the `page[size]` parameter. + + **Note**: You may experience a speed reduction or a timeout if you request 1000 results per page and you have many archived tickets in the results. Try reducing the number of results per page. We recommend 100 results per page. + + The cursor specified by the `after_cursor` property in a response expires after one hour. + + For more information on cursor-based pagination, see the following articles: + + - [Comparing cursor pagination and offset pagination](/documentation/developer-tools/pagination/comparing-cursor-pagination-and-offset-pagination) + - [Paginating through lists using cursor pagination](/documentation/developer-tools/pagination/paginating-through-lists-using-cursor-pagination) + + #### Export Search Results Limits + + This API endpoint is rate-limited to 100 requests per minute per account. The limit also counts towards the global API rate limit. + + #### Response Format + + | Name | Type | Comment + | --------------------- | ---------------------| -------------------- + | links[next] | string | URL to the next page of results + | meta[has_more] | string | Boolean indicating if there are more results + | meta[after_cursor] | string | Cursor object returned from the Search Service + | results | array | May consist of tickets, users, groups, or organizations, as specified by the `filter_type` parameter + + The response is similar to the response of `GET /api/v2/search?`, with a few changes: + + * `links` - Has the following nested properties: `prev` and `next`. These replace the `next_page` and `prev_page` links. The `prev` property is always null because backward pagination is not supported. The `next` property may include an auto-generated link to the next page of results. + * `meta` - Has the following nested properties: `has_more` and `after_cursor`. The `has_more` property indicates whether the next page has more results. The `after_cursor` property is the cursor used to paginate to the next page. It expires after one hour. + + There's no `count` property. + parameters: + - name: query + in: query + description: The search query. See [Query basics](#query-basics) above. For details on the query syntax, see the [Zendesk Support search reference](https://support.zendesk.com/hc/en-us/articles/203663226) + required: true + schema: + type: string + example: https://subdomain.zendesk.com/api/v2/search?query=type:ticket status:closed&sort_by=status&sort_order=desc + - name: page[size] + in: query + description: The number of results shown in a page. + schema: + type: integer + - name: page[after] + in: query + description: The cursor token for fetching the next page of results. + schema: + type: string + - name: filter[type] + in: query + description: The object type returned by the export query. Can be `ticket`, `organization`, `user`, or `group`. + schema: + type: string + - $ref: '#/components/parameters/SearchInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SearchExportResponse' + examples: + default: + $ref: '#/components/examples/SearchExportResponseExample' + /api/v2/security_settings: + get: + operationId: ShowSecuritySettings + tags: + - Security Settings + summary: Show Security Settings + description: | + #### Allowed For + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SecuritySettingsResponse' + examples: + default: + $ref: '#/components/examples/SecuritySettingsResponseExample' + /api/v2/sessions: + get: + operationId: ListSessions + tags: + - Sessions + summary: List Sessions + description: | + If authenticated as an admin, returns all the account's sessions. If authenticated as an agent or end user, returns only the sessions of the user making the request. + + #### Pagination + + - Cursor pagination only + + See [Pagination](/api-reference/introduction/pagination/). + + #### Allowed For + + * Admins, Agents, End users + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SessionsResponse' + examples: + default: + $ref: '#/components/examples/SessionsResponseExample' + /api/v2/sharing_agreements: + get: + operationId: ListSharingAgreements + tags: + - Sharing Agreements + summary: List Sharing Agreements + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SharingAgreementsResponse' + examples: + default: + $ref: '#/components/examples/SharingAgreementsResponseExample' + post: + operationId: CreateSharingAgreement + tags: + - Sharing Agreements + summary: Create Sharing Agreement + description: | + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/SharingAgreementResponse' + examples: + default: + $ref: '#/components/examples/SharingAgreementResponseExample' + /api/v2/sharing_agreements/{sharing_agreement_id}: + parameters: + - $ref: '#/components/parameters/SharingAgreementId' + get: + operationId: ShowSharingAgreement + tags: + - Sharing Agreements + summary: Show a Sharing Agreement + description: | + Returns a sharing agreement for your account. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SharingAgreementResponse' + examples: + default: + $ref: '#/components/examples/SharingAgreementResponseExample' + put: + operationId: UpdateSharingAgreement + tags: + - Sharing Agreements + summary: Update a Sharing Agreement + description: | + Returns an updated sharing agreement. Only `status` is allowed to be updated. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SharingAgreementResponse' + examples: + default: + $ref: '#/components/examples/SharingAgreementUpdateResponseExample' + delete: + operationId: DeleteSharingAgreement + tags: + - Sharing Agreements + summary: Delete a Sharing Agreement + description: | + Deletes a sharing agreement. + + #### Allowed For + + * Admins + responses: + "204": + description: No Content response + /api/v2/skips: + parameters: + - $ref: '#/components/parameters/TicketSortOrder' + get: + operationId: ListSkips + tags: + - Ticket Skips + summary: List All Skips + description: | + Lists all skips. Archived tickets are not included in the response. See + [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756) in + the Support Help Center. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + * Agents with "View only" or higher reports permissions in Support. + These permissions are distinct from Explore permissions. + * Agents retrieving their own skips + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketSkipsResponse' + examples: + default: + $ref: '#/components/examples/TicketSkipResponseExample' + post: + operationId: RecordNewSkip + tags: + - Ticket Skips + summary: Record a New Skip for the Current User + description: | + Record a new ticket skip for the current user. + + #### Allowed For + + * Agents + responses: + "201": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketSkipCreation' + examples: + default: + $ref: '#/components/examples/TicketSkipCreationExample' + /api/v2/slas/policies: + get: + operationId: ListSLAPolicies + tags: + - SLA Policies + summary: List SLA Policies + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SLAPoliciesResponse' + examples: + default: + $ref: '#/components/examples/SLAPoliciesResponseExample' + post: + operationId: CreateSLAPolicy + tags: + - SLA Policies + summary: Create SLA Policy + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/SLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/SLAPolicyCreateResponse' + /api/v2/slas/policies/{sla_policy_id}: + parameters: + - $ref: '#/components/parameters/SLAPolicyId' + get: + operationId: ShowSLAPolicy + tags: + - SLA Policies + summary: Show SLA Policy + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/SLAPolicyResponseExample' + put: + operationId: UpdateSLAPolicy + tags: + - SLA Policies + summary: Update SLA Policy + description: | + Updates the specified policy. + + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SLAPolicyResponse' + examples: + default: + $ref: '#/components/examples/SLAPolicyUpdateResponse' + delete: + operationId: DeleteSLAPolicy + tags: + - SLA Policies + summary: Delete SLA Policy + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "204": + description: No Content response + /api/v2/slas/policies/definitions: + get: + operationId: RetrieveSLAPolicyFilterDefinitionItems + tags: + - SLA Policies + summary: Retrieve Supported Filter Definition Items + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SLAPolicyFilterDefinitionResponse' + examples: + default: + $ref: '#/components/examples/SLAPolicyFilterDefinitionResponseExample' + /api/v2/slas/policies/reorder: + put: + operationId: ReorderSLAPolicies + tags: + - SLA Policies + summary: Reorder SLA Policies + description: | + #### Availability + + * Accounts on the Support Professional or Suite Growth plan or above + + #### Allowed For + + * Admins + parameters: + - name: sla_policy_ids + in: query + description: The IDs of the SLA Policies to reorder + schema: + type: array + items: + type: integer + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/suspended_tickets: + parameters: + - $ref: '#/components/parameters/SuspendedTicketsSortBy' + - $ref: '#/components/parameters/SuspendedTicketsSortOrder' + get: + operationId: ListSuspendedTickets + tags: + - Suspended Tickets + summary: List Suspended Tickets + description: | + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + + #### Sorting + + You can sort the tickets with the `sort_by` and `sort_order` query string parameters. + + #### Pagination + + * Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SuspendedTicketsResponse' + examples: + default: + $ref: '#/components/examples/SuspendedTicketsResponseExample' + /api/v2/suspended_tickets/{id}: + get: + operationId: ShowSuspendedTickets + tags: + - Suspended Tickets + summary: Show Suspended Ticket + description: | + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + parameters: + - $ref: '#/components/parameters/SuspendedTicketId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SuspendedTicketsResponse' + examples: + default: + $ref: '#/components/examples/SuspendedTicketsResponseExample' + delete: + operationId: DeleteSuspendedTicket + tags: + - Suspended Tickets + summary: Delete Suspended Ticket + description: | + #### Allowed For + + * Unrestricted agents + parameters: + - $ref: '#/components/parameters/SuspendedTicketId' + responses: + "204": + description: No Content response + /api/v2/suspended_tickets/{id}/recover: + put: + operationId: RecoverSuspendedTicket + tags: + - Suspended Tickets + summary: Recover Suspended Ticket + description: | + **Note**: During recovery, the API sets the requester to the authenticated agent who called the API, not the original requester. This prevents the ticket from being re-suspended after recovery. To preserve the original requester, use the [Recover Multiple Suspended Tickets](#recover-multiple-suspended-tickets) endpoint with the single ticket. + + This endpoint does not queue an asynchronous job that can be tracked from [Job Statuses](/api-reference/ticketing/ticket-management/job_statuses/). Instead, it processes the request with a synchronous response. + - If all recoveries are successful, it returns a 200 with a `tickets` array in the response. + - If all recoveries fail, it returns a 422 with a `suspended_tickets` array in the response. + - If there is a mixture of successes and failures in a single call, it returns a 422 with a `suspended_tickets` array of the failures in the response. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + parameters: + - $ref: '#/components/parameters/SuspendedTicketId' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuspendedTicketResponse' + examples: + default: + $ref: '#/components/examples/RecoverSuspendedTicketResponseExample' + "422": + description: Recovery failed response + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuspendedTicketUnprocessableContentResponse' + examples: + default: + $ref: '#/components/examples/RecoverSuspendedTicketUnprocessableContentResponseExample' + /api/v2/suspended_tickets/attachments: + post: + operationId: SuspendedTicketsAttachments + tags: + - Suspended Tickets + summary: Suspended Ticket Attachments + description: | + Makes copies of any attachments on a suspended ticket and returns them as [attachment tokens](/api-reference/ticketing/tickets/ticket-attachments/). If the ticket is manually recovered, you can include the attachment tokens on the new ticket. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SuspendedTicketsAttachmentsResponse' + examples: + default: + $ref: '#/components/examples/SuspendedTicketsAttachmentsResponseExample' + /api/v2/suspended_tickets/destroy_many: + parameters: + - $ref: '#/components/parameters/SuspendedTicketsDeleteIds' + delete: + operationId: DeleteSuspendedTickets + tags: + - Suspended Tickets + summary: Delete Multiple Suspended Tickets + description: | + Accepts up to 100 ids (the auto-generated id, not the ticket id.) + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + responses: + "204": + description: No Content response + /api/v2/suspended_tickets/export: + post: + operationId: ExportSuspendedTickets + tags: + - Suspended Tickets + summary: Export Suspended Tickets + description: | + Exports a list of suspended tickets for the Zendesk Support instance. To export the list, the endpoint enqueues a job to create a CSV file with the data. When done, Zendesk sends the requester an email containing a link to the CSV file. In the CSV, tickets are sorted by the update timestamp in ascending order. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + + #### Rate limits + + Limited to one request per minute and up to one million records in return. The rate-limiting mechanism behaves identically to the one described in [Usage limits](/api-reference/ticketing/account-configuration/usage_limits/#monitoring-your-request-activity). + We recommend using the `Retry-After` header value as described in [Catching errors caused by rate limiting](/documentation/ticketing/using-the-zendesk-api/best-practices-for-avoiding-rate-limiting#catch). + responses: + "200": + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/SuspendedTicketsExportResponse' + examples: + default: + $ref: '#/components/examples/SuspendedTicketsExportResponseExample' + /api/v2/suspended_tickets/recover_many: + parameters: + - $ref: '#/components/parameters/SuspendedTicketsRecoverIds' + put: + operationId: RecoverSuspendedTickets + tags: + - Suspended Tickets + summary: Recover Multiple Suspended Tickets + description: | + Accepts up to 100 ids (the auto-generated id, not the ticket id.) Note that suspended tickets that fail to be recovered are still included in the response. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage suspended tickets on Enterprise plans + * Unrestricted agents on all other plans + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuspendedTicketsResponse' + examples: + default: + $ref: '#/components/examples/RecoverSuspendedTicketsResponseExample' + /api/v2/tags: + get: + operationId: ListTags + tags: + - Tags + summary: List Tags + description: | + Lists up to the 20,000 most popular tags in the last 60 days, in decreasing popularity. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsResponse' + examples: + default: + $ref: '#/components/examples/TagsResponseExample' + /api/v2/tags/count: + get: + operationId: CountTags + tags: + - Tags + summary: Count Tags + description: | + Returns an approximate count of tags. If the count exceeds 100,000, it + is updated every 24 hours. + + The `refreshed_at` property of the `count` object is a timestamp that indicates when + the count was last updated. + + **Note**: When the count exceeds 100,000, the `refreshed_at` property in the `count` object may + occasionally be null. This indicates that the count is being + updated in the background and the `value` property in the `count` object is limited to + 100,000 until the update is complete. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagCountResponse' + examples: + default: + $ref: '#/components/examples/TagCountResponseExample' + /api/v2/target_failures: + get: + operationId: ListTargetFailures + tags: + - Target Failures + summary: List Target Failures + description: | + Returns the 25 most recent target failures, per target. + + #### Stability + + * Development + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetFailuresResponse' + examples: + default: + $ref: '#/components/examples/TargetFailuresResponseExample' + /api/v2/target_failures/{target_failure_id}: + parameters: + - $ref: '#/components/parameters/TargetFailureId' + get: + operationId: ShowTargetFailure + tags: + - Target Failures + summary: Show Target Failure + description: | + #### Stability + + * Development + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetFailureResponse' + examples: + default: + $ref: '#/components/examples/TargetFailureResponseExample' + /api/v2/targets: + get: + operationId: ListTargets + tags: + - Targets + summary: List Targets + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetsResponse' + examples: + default: + $ref: '#/components/examples/TargetsResponseExample' + post: + operationId: CreateTarget + tags: + - Targets + summary: Create Target + description: | + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetResponse' + examples: + default: + $ref: '#/components/examples/TargetCreateResponseExample' + /api/v2/targets/{target_id}: + parameters: + - $ref: '#/components/parameters/TargetId' + get: + operationId: ShowTarget + tags: + - Targets + summary: Show Target + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetResponse' + examples: + default: + $ref: '#/components/examples/TargetResponseExample' + put: + operationId: UpdateTarget + tags: + - Targets + summary: Update Target + description: | + #### Allowed For + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetResponse' + examples: + default: + $ref: '#/components/examples/TargetUpdateResponseExample' + delete: + operationId: DeleteTarget + tags: + - Targets + summary: Delete Target + description: | + #### Allowed For + * Admins + responses: + "204": + description: No Content response + /api/v2/task_list_templates: + get: + operationId: ListTaskListTemplates + tags: + - Task List Templates + summary: List Task List Templates + description: | + Lists all task list templates. The template's tasks aren't included in the response. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplatesResponse' + examples: + default: + $ref: '#/components/examples/TaskListTemplatesResponseExample' + post: + operationId: CreateTaskListTemplate + tags: + - Task List Templates + summary: Create Task List Template + description: |- + Creates a task list template. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplateCreateRequest' + examples: + default: + $ref: '#/components/examples/TaskListTemplateCreateRequestExample' + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplateResponse' + examples: + default: + $ref: '#/components/examples/TaskListTemplateWithItemsResponseExample' + /api/v2/task_list_templates/{task_list_template_id}: + parameters: + - $ref: '#/components/parameters/TaskListTemplateId' + get: + operationId: ShowTaskListTemplate + tags: + - Task List Templates + summary: Show Task List Template + description: | + Returns the task list template with the specified id. The template's tasks aren't included in the response. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplateResponse' + examples: + default: + $ref: '#/components/examples/TaskListTemplateResponseExample' + put: + operationId: UpdateTaskListTemplate + tags: + - Task List Templates + summary: Update Task List Template + description: |- + Creates, modifies, or deletes tasks in a task list template. Only the tasks included in the `task_list_template` object in the request are updated. Tasks that aren't specified in the request are unchanged. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplateUpdateRequest' + examples: + default: + $ref: '#/components/examples/TaskListTemplateUpdateRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListTemplateResponse' + examples: + default: + $ref: '#/components/examples/TaskListTemplateWithItemsResponseExample' + delete: + operationId: DeleteTaskListTemplate + tags: + - Task List Templates + summary: Delete Task List Template + description: |- + Deletes a task list template with the specified id. + + #### Allowed For + + * Admins + responses: + "204": + description: No content response + /api/v2/task_list_templates/{task_list_template_id}/tasks: + parameters: + - $ref: '#/components/parameters/TaskListTemplateId' + get: + operationId: GetTasksByTaskListTemplateId + tags: + - Task List Templates + summary: Get Tasks by Task List Template Id + description: | + Returns the tasks for the specified task list template. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TasksByTaskListTemplateIdResponse' + examples: + default: + $ref: '#/components/examples/TasksByTaskListTemplateIdResponseExample' + /api/v2/ticket_audits: + get: + operationId: ListTicketAudits + tags: + - Ticket Audits + summary: List All Ticket Audits + description: | + Returns ticket audits. Archived tickets are not included in the response. Use the [List Audits for a Ticket](#list-audits-for-a-ticket) endpoint to + retrieve audit records for an archived ticket. To learn more about archived tickets, see [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756). + + This endpoint should not be used for capturing change data. When continually chasing the tail of a cursor, some records will be skipped. For this use case, use the [Incremental Ticket Event Export API](/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-event-export). + + #### Allowed For + + * Admins + parameters: + - name: page[before] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.before_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[after] + in: query + description: | + A [pagination cursor](/documentation/api-basics/pagination/paginating-through-lists-using-cursor-pagination) that tells the endpoint which page to start on. It should be a `meta.after_cursor` value from a previous request. Note: `page[before]` and `page[after]` can't be used together in the same request. + schema: + type: string + - name: page[size] + in: query + description: Specifies how many records to be returned in the response. You can specify up to 100 records per page. + schema: + type: integer + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketAuditsResponse' + examples: + default: + $ref: '#/components/examples/TicketAuditsResponseExample' + /api/v2/ticket_content_pins: + get: + operationId: ListTicketContentPins + tags: + - Ticket Content Pins + summary: List Ticket Content Pins + description: | + Lists the content pins for a specific ticket. Content pins are used to pin related content such as articles to a ticket for quick access. This endpoint returns the content pins associated with the specified ticket id. + + #### Allowed For + + * Agents + parameters: + - name: ticket_id + in: query + description: The id of the ticket for which to list content pins + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + description: Total number of content pins for the ticket. + ticket_content_pins: + type: array + items: + $ref: '#/components/schemas/TicketContentPin' + examples: + default: + $ref: '#/components/examples/TicketContentPinsExample' + post: + operationId: CreateTicketContentPin + tags: + - Ticket Content Pins + summary: Create Ticket Content Pin + description: | + Creates a new content pin for a specific ticket. Content pins allow you to link to articles, community posts, or external content for easy reference. + + #### Allowed For + + * Admins + * Agents + requestBody: + description: | + Creates a new content pin for a specific ticket. The content pin can link to articles, topics, or other relevant content. + required: true + content: + application/json: + schema: + type: object + properties: + ticket_content_pin: + type: object + properties: + content_id: + type: string + description: The id of the content to pin + content_type: + type: string + description: The type of content being pinned. + locale: + type: string + description: The locale for the content pin. This is required only for articles. + ticket_id: + type: string + description: The id of the ticket to which the content pin will be added + required: + - ticket_id + - content_id + - content_type + examples: + default: + value: + ticket_content_pin: + content_id: 01HFS51MMTVW7CMVEV5V51NYV5 + content_type: article + locale: en-US + ticket_id: "12345" + responses: + "201": + description: Content pin created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/TicketContentPin' + examples: + default: + $ref: '#/components/examples/TicketContentPinExample' + "400": + description: Bad Request + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + description: Detailed message explaining the error. + title: + type: string + description: Error title indicating the nature of the bad request. + examples: + default: + value: + error: + message: ticket_id must be a string + title: Invalid attribute + "409": + description: Conflict + content: + application/json: + schema: + type: object + properties: + description: + type: string + description: Detailed description of the conflict. + error: + type: string + description: Error message indicating a conflict. + examples: + default: + value: + description: A conflicting operation is in progress, please try again later + error: ContentPinCreationConflict + "422": + description: Unprocessable Entity + content: + application/json: + schema: + type: object + properties: + description: + type: string + description: Detailed description of the error. + error: + type: string + description: Error message indicating why the request failed. + examples: + default: + value: + description: The content with ID 12345 is already pinned to this ticket. + error: ContentAlreadyPinned + /api/v2/ticket_content_pins/{content_pin_id}: + delete: + operationId: DeleteTicketContentPin + tags: + - Ticket Content Pins + summary: Delete Content Pin from Ticket + description: | + Deletes a specific content pin from a ticket. + + #### Allowed For + + * Agents + parameters: + - name: content_pin_id + in: path + description: The id of the content pin to delete + required: true + schema: + type: string + example: 01HFS51MMTVW7CMVEV5V51NYV5 + responses: + "200": + description: Content pin deleted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/TicketContentPin' + examples: + default: + $ref: '#/components/examples/TicketContentPinExample' + "404": + description: Content pin not found + content: + application/json: + schema: + type: object + properties: + description: + type: string + error: + type: string + examples: + default: + value: + description: Not found + error: RecordNotFound + /api/v2/ticket_fields: + get: + operationId: ListTicketFields + tags: + - Ticket Fields + summary: List Ticket Fields + description: | + Returns a list of all system and custom ticket fields in your account. + + For end users, only the ticket fields with visible_in_portal set to true are returned. + + Cursor pagination returns a maximum of 100 records per page and fields are returned in the order specified by their id. + + If the results are not paginated, every field is returned in the response and fields are returned in the order specified by the position. + + You can adjust the position of ticket fields by: + + - Using the [Update Ticket Field](/api-reference/ticketing/tickets/ticket_fields/#update-ticket-field) endpoint + - Using the [Reorder Ticket Fields](/api-reference/ticketing/tickets/ticket_fields/#reorder-ticket-fields) endpoint + - Ticket Fields page in the Admin Center (**Admin Center** > **Manage** > **Ticket** > **Fields** > **Actions** > **Edit order**) + + These adjustments determine the order in which fields are displayed in various locations. For accounts without access to multiple ticket forms, the order will also be used to display field values within tickets. However, for accounts with access to multiple ticket forms, the field order on the ticket page is defined within each form. + + Consider caching this resource to use with the [Tickets](/api-reference/ticketing/tickets/tickets/#json-format) API. + + #### Pagination + + - Cursor pagination (recommended) + - No pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | users | The user or users that created the ticket field + + #### Allowed For + + * Anyone + parameters: + - name: locale + in: query + description: | + Forces the `title_in_portal` property to return a dynamic content variant for the specified locale. + Only accepts [active locale ids](/api-reference/ticketing/account-configuration/locales/#list-locales). + Example: `locale="de"`. + schema: + type: string + - name: creator + in: query + description: | + Displays the `creator_user_id` and `creator_app_name` properties. If the ticket field is created + by an app, `creator_app_name` is the name of the app and `creator_user_id` is `-1`. If the ticket field + is not created by an app, `creator_app_name` is null + schema: + type: boolean + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldsResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldsResponseExample' + post: + operationId: CreateTicketField + tags: + - Ticket Fields + summary: Create Ticket Field + description: | + Creates any of the following custom field types: + + | Custom field type | Description | + |-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| + | text | Default custom field type when `type` is not specified | + | textarea | For multi-line text | + | checkbox | To capture a boolean value. Allowed values are true or false. Optionally, you can specify a tag to be added to the ticket when the value is true. | + | date | Example: 2021-04-16 | + | integer | String composed of numbers. May contain an optional decimal point | + | decimal | For numbers containing decimals | + | regexp | Matches the Regex pattern found in the custom field settings | + | partialcreditcard | A credit card number. Only the last 4 digits are retained | + | multiselect | Enables users to choose multiple options from a dropdown menu. It contains one or more tag values belonging to the field's options. | + | tagger | Single-select dropdown menu. It contains one or more tag values belonging to the field's options. Example: ( {"id": 21938362, "value": ["hd_3000", "hd_5555"]}) | + | lookup | A field to create a relationship (see [lookup relationships](/api-reference/ticketing/lookup_relationships/lookup_relationships/)) to another object such as a user, ticket, or organization | + + **Note**: Tags can't be re-used across custom ticket fields. For example, if you configure a tag for a checkbox field, you can't use that tag value for a dropdown (tagger) field option. The use of tags isn't validated and can prevent editing in the future. + + See [About custom field types](https://support.zendesk.com/hc/en-us/articles/203661866) in the Zendesk Help Center. + + #### Allowed For + + * Admins + + #### Field limits + + We recommend the following best practices for ticket fields limits. Creating more than these amounts can affect performance. + + * 400 ticket fields per account if your account doesn't have ticket forms + * 400 ticket fields per ticket form if your account has ticket forms + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldResponseExample' + /api/v2/ticket_fields/{ticket_field_id}: + parameters: + - $ref: '#/components/parameters/TicketFieldId' + - $ref: '#/components/parameters/Creator' + get: + operationId: ShowTicketfield + tags: + - Ticket Fields + summary: Show Ticket Field + description: | + #### Allowed for + + * Agents + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | users | The user or users that created the ticket field + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldResponseExample' + put: + operationId: UpdateTicketField + tags: + - Ticket Fields + summary: Update Ticket Field + description: | + #### Updating drop-down field options + + You can also use the update endpoint to add, update, or remove options in a drop-down custom field. Updating field options for multi-select fields works exactly the same as drop-down field options. + + **Important**: Unless you want to remove some options, you must specify all existing options in any update request. Omitting an option removes it from the drop-down field, which removes its values from any tickets or macros. + + Use the `custom_field_options` attribute to update the options. The attribute consists of an array of option objects, with each object consisting of a `name`, `value` and `allow_solving` property. The properties correspond to the "Title", "Tag" and "Required to solve" boxes in the admin interface. Example request body: + + ```json + {"ticket_field": { + "custom_field_options": [ + {"name": "Apple Pie", "value": "apple", "allow_solving": true}, + {"name": "Pecan Pie", "value": "pecan", "allow_solving": false} + ] + } + } + ``` + + #### Example Request + + ```bash + curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id} \ + -d '{"ticket_field": {"custom_field_options": [{"name": "Apple Pie", "value": "apple", "allow_solving": true}, {"name": "Pecan Pie", "value": "pecan", "allow_solving": false}]}}' \ + -H "Content-Type: application/json" -X PUT \ + -v -u {email_address}/token:{api_token} + ``` + + #### Example Response + + ```http + Status: 200 OK + + { + "ticket_field": { + "id":21938362, + "type":"tagger", + "title":"Pies", + ... + "custom_field_options": [ + { + "id":21029772, + "name":"Apple Pie", + "raw_name":"Apple Pie", + "value":"apple", + "default":false, + "allow_solving":true + }, + ... + ] + } + } + ``` + + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldUpdateResponseExample' + delete: + operationId: DeleteTicketField + tags: + - Ticket Fields + summary: Delete Ticket Field + description: | + #### Allowed for + + * Admins + responses: + "204": + description: No Content response + /api/v2/ticket_fields/{ticket_field_id}/options: + parameters: + - $ref: '#/components/parameters/TicketFieldId' + get: + operationId: ListTicketFieldOptions + tags: + - Ticket Fields + summary: List Ticket Field Options + description: | + Returns a list of custom ticket field options for the given drop-down ticket field. + + #### Allowed For + + * Agents + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionsResponse' + examples: + default: + $ref: '#/components/examples/CustomTicketFieldOptionsResponseExample' + post: + operationId: CreateOrUpdateTicketFieldOption + tags: + - Ticket Fields + summary: Create or Update Ticket Field Option + description: | + Creates or updates an option for the given drop-down ticket field. + + To update an option, include the id of the option in the `custom_field_option` object. Example: + + `{"custom_field_option": {"id": 10002, "name": "Pineapples", ... }` + + If an option exists for the given ID, the option will be updated. Otherwise, a new option will be created. + + #### Response + + Returns one of the following status codes: + + - 200 with `Location: /api/v2/ticket_fields/{ticket_field_id}/options` if the ticket field option already exists in the database + - 201 with `Location: /api/v2/ticket_fields/{ticket_field_id}/options` if the ticket field option is new + + #### Allowed For + + * Admins + + #### Rate Limit + You can make 100 requests every 1 minute using this endpoint. + The rate limiting mechanism behaves as described in + [Monitoring your request activity](/api-reference/ticketing/account-configuration/usage_limits/#monitoring-your-request-activity) in the API introduction. + + #### Field Option Limits + + * 2000 options per ticket field + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomTicketFieldOptionUpdateResponseExample' + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomTicketFieldOptionCreateResponseExample' + /api/v2/ticket_fields/{ticket_field_id}/options/{ticket_field_option_id}: + parameters: + - $ref: '#/components/parameters/TicketFieldId' + - $ref: '#/components/parameters/TicketFieldOptionId' + get: + operationId: ShowTicketFieldOption + tags: + - Ticket Fields + summary: Show Ticket Field Option + description: | + #### Allowed for + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomTicketFieldOptionResponseExample' + delete: + operationId: DeleteTicketFieldOption + tags: + - Ticket Fields + summary: Delete Ticket Field Option + description: | + #### Allowed for + * Admins + responses: + "204": + description: No Content response + /api/v2/ticket_fields/count: + get: + operationId: CountTicketFields + tags: + - Ticket Fields + summary: Count Ticket Fields + description: |- + Returns an approximate count of system and custom ticket fields in the account. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of ticket fields + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldCountResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldCountResponseExample' + /api/v2/ticket_fields/reorder: + put: + operationId: ReorderTicketFields + tags: + - Ticket Fields + summary: Reorder Ticket Fields + description: | + #### Allowed For + * Admins + + #### Request Parameters + + You can pass in the following parameter in the payload: + + | Name | Type | Comment + | ------------------- | ------ | -------- + | ticket_field_ids | array | An array of ticket field ids. Example: "[2, 23, 46, 50]". Not all ticket_field_ids are necessary in the payload; only those provided will be assigned to the first positions. Missing IDs will be assigned incremental positions automatically. + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/ticket_fields/show_many: + get: + operationId: ShowManyTicketFields + tags: + - Ticket Fields + summary: Show Many Ticket Fields + description: | + Returns multiple ticket fields in a single request. + + Provide either: + - `ids` — a comma-separated list of ticket field IDs, or + - `keys` — a comma-separated list of ticket field keys + + Up to 100 values are accepted. + + The response payload matches the List Ticket Fields [response format](/api-reference/ticketing/tickets/ticket_fields/#example-responses). + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload | + |-------|---------------------------------------| + | users | The user or users that created fields | + + #### Allowed For + + * Anyone + parameters: + - name: ids + in: query + description: | + Comma-separated list of ticket field IDs to retrieve. Up to 100 values accepted. + + Either `ids` or `keys` can be used, but not both. + schema: + type: string + example: 123,456,789 + - name: keys + in: query + description: | + Comma-separated list of ticket field keys to retrieve. Up to 100 values accepted. + + Use field keys like 'priority', 'status', 'subject' instead of numeric IDs. + + Either `ids` or `keys` can be used, but not both. + schema: + type: string + example: priority,status,subject + - name: creator + in: query + description: | + If true, includes creator information in the response. + schema: + type: boolean + - name: exclude_sub_selection_options + in: query + description: | + If true, excludes sub-selection options from dropdown fields in the response. + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFieldsShowManyResponse' + examples: + default: + $ref: '#/components/examples/TicketFieldsShowManyResponseExample' + /api/v2/ticket_form_statuses: + get: + operationId: ListTicketFormStatuses + tags: + - Ticket Form Statuses + summary: List Ticket Form Statuses + description: | + Fetches all of the ticket form statuses for the account. + + Supports filtering by ticket form ID and other criteria using query parameters. + + #### Allowed For + + * Admins + * Agents + parameters: + - name: ticket_form_id + in: query + description: | + Filter by ticket form ID. + + Supports single ID or comma-separated list of IDs. + schema: + type: string + examples: + multiple: + summary: Multiple form IDs + value: 123,456,789 + single: + summary: Single form ID + value: "123456" + - name: filter + in: query + description: Additional filter criteria + style: deepObject + explode: true + schema: + type: object + properties: + custom_status_id: + type: string + description: Filter by custom status ID (comma-separated) + id: + type: string + description: Filter by status ID (comma-separated) + example: + custom_status_id: "789" + id: 123,456 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + /api/v2/ticket_form_statuses/show_many: + get: + operationId: ShowManyTicketFormStatuses + tags: + - Ticket Form Statuses + summary: Show Many Ticket Form Statuses + description: | + Fetches all of the ticket form statuses specified by a comma separated list of ids. + + #### Allowed For + + * Anyone + parameters: + - name: ids + in: query + description: Ticket form status ids to retrieve records for + required: true + schema: + type: string + example: abc,def,ghi + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + /api/v2/ticket_forms: + get: + operationId: ListTicketForms + tags: + - Ticket Forms + summary: List Ticket Forms + description: | + Returns a list of all ticket forms for your account if accessed as an admin or agent. End users only see ticket forms that have `end_user_visible` set to true. + + #### Allowed For + + * Anyone + parameters: + - name: active + in: query + description: true returns active ticket forms; false returns inactive ticket forms. If not present, returns both + schema: + type: boolean + - name: end_user_visible + in: query + description: true returns ticket forms where `end_user_visible`; false returns ticket forms that are not end-user visible. If not present, returns both + schema: + type: boolean + - name: fallback_to_default + in: query + description: true returns the default ticket form when the criteria defined by the parameters results in a set without active and end-user visible ticket forms + schema: + type: boolean + - name: form_type + in: query + description: Filter ticket forms by type. Use 'standard' for regular ticket forms, 'service_catalog' for service catalog forms, or 'all' to return all form types + schema: + type: string + enum: + - standard + - service_catalog + - all + example: standard + - name: associated_to_brand + in: query + description: true returns the ticket forms of the brand specified by the url's subdomain + schema: + type: boolean + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + - name: locale + in: query + description: Locale to use for the ticket form names. If not specified, the default locale is used. + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormsResponse' + examples: + default: + $ref: '#/components/examples/TicketFormsResponseExample' + post: + operationId: CreateTicketForm + tags: + - Ticket Forms + summary: Create Ticket Form + description: | + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormResponse' + examples: + default: + $ref: '#/components/examples/TicketFormCreateResponseExample' + /api/v2/ticket_forms/{ticket_form_id}: + parameters: + - $ref: '#/components/parameters/TicketFormId' + get: + operationId: ShowTicketForm + tags: + - Ticket Forms + summary: Show Ticket Form + description: | + #### Allowed For + + * Admins, Agents, and End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormResponse' + examples: + default: + $ref: '#/components/examples/TicketFormResponseExample' + put: + operationId: UpdateTicketForm + tags: + - Ticket Forms + summary: Update Ticket Form + description: | + #### Allowed For + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormResponse' + examples: + default: + $ref: '#/components/examples/TicketFormUpdateResponseExample' + delete: + operationId: DeleteTicketForm + tags: + - Ticket Forms + summary: Delete Ticket Form + description: | + #### Allowed For + * Admins + responses: + "204": + description: No Content response + /api/v2/ticket_forms/{ticket_form_id}/clone: + parameters: + - $ref: '#/components/parameters/TicketFormId' + post: + operationId: CloneTicketForm + tags: + - Ticket Forms + summary: Clone an Already Existing Ticket Form + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormResponse' + examples: + default: + $ref: '#/components/examples/TicketFormResponseExample' + /api/v2/ticket_forms/{ticket_form_id}/ticket_form_statuses: + parameters: + - $ref: '#/components/parameters/TicketFormId' + get: + operationId: TicketFormTicketFormStatuses + tags: + - Ticket Forms + - Ticket Form Statuses + summary: List Ticket Form Statuses of a Ticket Form + description: | + Fetches all of the associated ticket form statuses of a ticket form. + + #### Allowed For + + * Anyone + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + post: + operationId: CreateTicketFormStatuses + tags: + - Ticket Forms + - Ticket Form Statuses + summary: Create Ticket Form Statuses + description: | + Creates one or many ticket form status associations + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesParams' + example: + ticket_form_status: + - custom_status_id: 1234 + - custom_status_id: 1235 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + put: + operationId: UpdateTicketFormStatuses + tags: + - Ticket Forms + - Ticket Form Statuses + summary: Bulk Update Ticket Form Statuses of a Ticket Form + description: | + Updates or deletes ticket form status associations. This is a bulk operation that can both add and remove ticket form status associations for a form in one call. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTicketFormStatusesParams' + example: + ticket_form_status: + - _destroy: "1" + id: abcdef + - custom_status_id: 1 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + delete: + operationId: DeleteTicketFormStatuses + tags: + - Ticket Form Statuses + summary: Delete Ticket Form Statuses + description: | + Deletes all of of the ticket form statuses by id. + + #### Allowed For + + * Admins + * Agents + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + type: array + description: List of ids to delete + items: + type: string + example: + id: + - abc + - def + - hij + responses: + "204": + description: Success response + /api/v2/ticket_forms/{ticket_form_id}/ticket_form_statuses/{ticket_form_status_id}: + parameters: + - $ref: '#/components/parameters/TicketFormId' + - $ref: '#/components/parameters/TicketFormStatusId' + put: + operationId: UpdateTicketFormStatusById + tags: + - Ticket Forms + - Ticket Form Statuses + summary: Update Ticket Form Status By Id + description: | + Updates or deletes ticket form status association by id. + + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTicketFormStatusesParams' + example: + ticket_form_status: + - custom_status_id: 1 + - custom_status_id: 2 + - custom_status_id: 3 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormStatusesResponse' + examples: + default: + $ref: '#/components/examples/TicketFormStatusesResponseExample' + delete: + operationId: DeleteTicketFormStatusById + tags: + - Ticket Form Statuses + summary: Delete Ticket Form Status By Id + description: | + Deletes a ticket form status by id. + + #### Allowed For + + * Admins + responses: + "204": + description: Success response + /api/v2/ticket_forms/reorder: + put: + operationId: ReorderTicketForms + tags: + - Ticket Forms + summary: Reorder Ticket Forms + description: | + #### Allowed For + * Admins + + #### Request Parameters + + You can pass in the following parameter in the payload: + + | Name | Type | Comment + | ------------------- | ------ | -------- + | ticket_form_ids | array | An array of ticket form ids. Example: "[2, 23, 46, 50]" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormsResponse' + examples: + default: + $ref: '#/components/examples/TicketFormsResponseExample' + /api/v2/ticket_forms/show_many: + get: + operationId: ShowManyTicketForms + tags: + - Ticket Forms + summary: Show Many Ticket Forms + description: | + Takes an `ids` query parameter that accepts a comma-separated list of up to 100 ticket form ids. This endpoint is used primarily by the [mobile SDK](/documentation/classic-web-widget-sdks/) and the [Web Widget](/api-reference/widget/introduction/). + + #### Allowed For + + * Anyone + parameters: + - name: ids + in: query + description: IDs of the ticket forms to be shown + required: true + schema: + type: string + example: 1,2,3 + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + - name: active + in: query + description: true returns active ticket forms; false returns inactive ticket forms. If not present, returns both + schema: + type: boolean + - name: end_user_visible + in: query + description: true returns ticket forms where `end_user_visible`; false returns ticket forms that are not end-user visible. If not present, returns both + schema: + type: boolean + - name: fallback_to_default + in: query + description: true returns the default ticket form when the criteria defined by the parameters results in a set without active and end-user visible ticket forms + schema: + type: boolean + - name: associated_to_brand + in: query + description: true returns the ticket forms of the brand specified by the url's subdomain + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketFormsResponse' + examples: + default: + $ref: '#/components/examples/TicketFormsResponseExample' + /api/v2/ticket_metrics: + get: + operationId: ListTicketMetrics + tags: + - Ticket Metrics + summary: List Ticket Metrics + description: | + Returns a list of tickets with their metrics. + + Tickets are ordered chronologically by created date, from newest to oldest. + The last ticket listed may not be the absolute oldest ticket in your account + due to ticket archiving. + + Archived tickets are not included in the response. See + [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756) in + Zendesk help. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketMetricsResponse' + examples: + default: + $ref: '#/components/examples/TicketMetricsResponseExample' + /api/v2/ticket_metrics/{ticket_metric_id}: + get: + operationId: ShowTicketMetrics + tags: + - Ticket Metrics + summary: Show Ticket Metrics + description: | + Returns a specific metric, or the metrics of a specific ticket. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - name: ticket_metric_id + in: path + description: The id of the ticket metric to retrieve + required: true + schema: + type: string + example: "10001" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketMetricsByTicketMetricIdResponse' + examples: + default: + $ref: '#/components/examples/TicketMetricResponseExample' + /api/v2/tickets: + get: + operationId: ListTickets + tags: + - Tickets + summary: List Tickets + parameters: + - name: external_id + in: query + description: Lists tickets by external id. External ids don't have to be unique for each ticket. As a result, the request may return multiple tickets with the same external id. + schema: + type: string + - $ref: '#/components/parameters/TicketSortBy' + - $ref: '#/components/parameters/TicketSortOrder' + - $ref: '#/components/parameters/TicketSupportTypeScope' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/TicketsInclude' + - name: start_time + in: query + description: | + Unix epoch time to filter tickets. Only tickets created or updated after + this time are returned. Example: `?start_time=1332034771` + schema: + type: integer + example: 1332034771 + responses: + "200": + description: List tickets + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + post: + operationId: CreateTicket + tags: + - Tickets + summary: Create Ticket + parameters: + - $ref: '#/components/parameters/TicketsInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCreateRequest' + examples: + default: + $ref: '#/components/examples/TicketCreateRequestExample' + responses: + "201": + description: Create ticket + headers: + Location: + description: The URL of the created ticket + schema: + type: string + format: uri + content: + application/json: + schema: + $ref: '#/components/schemas/TicketResponse' + examples: + default: + $ref: '#/components/examples/TicketResponseExample' + /api/v2/tickets/{ticket_id}: + get: + operationId: ShowTicket + tags: + - Tickets + summary: Show Ticket + description: |- + Returns a number of ticket properties, but doesn't include the full comment thread. The initial comment is available in the ticket's [description property](/api-reference/ticketing/tickets/tickets/#json-format). To retrieve all the ticket's comments, use [List Comments](/api-reference/ticketing/tickets/ticket_comments/#list-comments). + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketsInclude' + - name: reduced_payload_size + in: query + description: When true, returns a reduced ticket payload (omits null custom fields). + schema: + type: boolean + - name: remove_duplicate_fields + in: query + description: When true, removes duplicate custom field entries from the response. + schema: + type: boolean + responses: + "200": + description: Ticket + content: + application/json: + schema: + $ref: '#/components/schemas/TicketResponse' + examples: + default: + $ref: '#/components/examples/TicketResponseExample' + put: + operationId: UpdateTicket + tags: + - Tickets + summary: Update Ticket + parameters: + - $ref: '#/components/parameters/TicketId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketUpdateRequest' + examples: + default: + $ref: '#/components/examples/TicketUpdateRequestExample' + responses: + "200": + description: Successful request + content: + application/json: + schema: + $ref: '#/components/schemas/TicketUpdateResponse' + examples: + default: + $ref: '#/components/examples/TicketUpdateResponseExample' + delete: + operationId: DeleteTicket + tags: + - Tickets + summary: Delete Ticket + description: |- + #### Allowed For + + * Admins + * Agents with permission to delete tickets + + Agent delete permissions are set in Support. See + [Deleting tickets](https://support.zendesk.com/hc/en-us/articles/203690936) + in the Support Help Center. + + #### Ticket deletion rate limit + + You can delete 400 tickets every 1 minute using this endpoint. + The rate limiting mechanism behaves as described in + [Rate limits](/api-reference/introduction/rate-limits/) in the API introduction. + Zendesk recommends that you obey the Retry-After header values. + To delete many tickets, you may use [Bulk Delete Tickets](/api-reference/ticketing/tickets/tickets/#bulk-delete-tickets). + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "204": + description: No content + /api/v2/tickets/{ticket_id}/audits: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ListAuditsForTicket + tags: + - Ticket Audits + summary: List Audits for a Ticket + description: | + Lists the audits for a specified ticket. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + **Note**: Audits for [Archived Tickets](https://support.zendesk.com/hc/en-us/articles/4408887617050) do not support pagination for this endpoint. + + #### Allowed for + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeSideloads' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + - name: filter_events + in: query + description: Filter audit events by type. Use the format `filter_events[]=Type1&filter_events[]=Type2`. + style: form + explode: true + schema: + type: array + items: + type: string + - $ref: '#/components/parameters/TicketSortOrder' + responses: + "200": + description: OK response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketAuditsResponseNoneCursor' + examples: + default: + $ref: '#/components/examples/TicketAuditsForTicketResponseExample' + /api/v2/tickets/{ticket_id}/audits/{ticket_audit_id}: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketAuditId' + get: + operationId: ShowTicketAudit + tags: + - Ticket Audits + summary: Show Audit + description: | + #### Allowed for + + * Agents + responses: + "200": + description: OK response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketAuditResponse' + examples: + default: + $ref: '#/components/examples/TicketAuditResponseExample' + /api/v2/tickets/{ticket_id}/audits/{ticket_audit_id}/make_private: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketAuditId' + put: + operationId: MakeTicketCommentPrivateFromAudits + tags: + - Ticket Audits + summary: Change a Comment From Public To Private + description: | + #### Allowed for + + * Agents + responses: + "200": + description: description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/tickets/{ticket_id}/audits/count: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: CountAuditsForTicket + tags: + - Ticket Audits + summary: Count Audits for a Ticket + description: | + Returns an approximate count of audits for a specified ticket. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: If the total number of audits for a ticket exceeds 100,000, this endpoint returns a count of 100,000 with a `count[refreshed_at]` value of null. This value is cached for 24 hours, during which any requests returns the same count and timestamp. After 24 hours, the endpoint temporarily shows the same count again before providing an updated total. + + #### Allowed for + + * Agents + responses: + "200": + description: Count of audits on a ticket + content: + application/json: + schema: + $ref: '#/components/schemas/TicketAuditsCountResponse' + examples: + default: + $ref: '#/components/examples/TicketAuditsCountResponseExample' + /api/v2/tickets/{ticket_id}/collaborators: + get: + operationId: ListTicketCollaborators + tags: + - Tickets + summary: List Collaborators for a Ticket + description: |- + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketCollaboratorsResponse' + examples: + default: + $ref: '#/components/examples/ListTicketCollaboratorsResponseExample' + /api/v2/tickets/{ticket_id}/comments: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ListTicketComments + tags: + - Ticket Comments + summary: List Comments + description: | + Returns the comments added to the ticket. + + Each comment may include a `content_url` for an attachment or a `recording_url` for a voice comment that points to a file that may be hosted externally. For security reasons, take care not to inadvertently send Zendesk authentication credentials to third parties when attempting to access these files. See [Working with url properties](/documentation/api-basics/best-practices/working-with-url-properties/). + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Sorting + + By default, comments are sorted by creation date in ascending order. + + When using cursor pagination, use the following parameter to change the sort order: + + | Name | Type | Required | Comments + | ------ | ------ | -------- | -------- + | `sort` | string | no | Possible values are "created_at" (ascending order) or "-created_at" (descending order) + + When using offset pagination, use the following parameters to change the sort order: + + | Name | Type | Required | Comments + | ------------ | ------ | -------- | -------- + | `sort_order` | string | no | One of `asc`, `desc`. Defaults to `asc` + + #### Allowed For + + * Agents + parameters: + - name: include_inline_images + in: query + description: Default is false. When true, inline images are also listed as attachments in the response + schema: + type: boolean + - name: include + in: query + description: 'Accepts "users". Use this parameter to list email CCs by side-loading users. Example: `?include=users`. **Note**: If the comment source is email, a deleted user will be represented as the CCd email address. If the comment source is anything else, a deleted user will be represented as the user name.' + schema: + type: string + - $ref: '#/components/parameters/PerPage' + - name: sort_order + in: query + description: Sort order. Defaults to "asc" + schema: + type: string + enum: + - asc + - desc + - $ref: '#/components/parameters/CursorPaginationPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentsResponse' + examples: + default: + $ref: '#/components/examples/TicketCommentsResponseExample' + /api/v2/tickets/{ticket_id}/comments/{comment_id}/attachments/{attachment_id}/redact: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/CommentId' + - $ref: '#/components/parameters/AttachmentId' + put: + operationId: RedactCommentAttachment + tags: + - Attachments + summary: Redact Comment Attachment + description: | + Redaction allows you to permanently remove attachments from an existing comment on a ticket. Once removed from a comment, the attachment is replaced with an empty "redacted.txt" file. + + The redaction is permanent. It is not possible to undo redaction or see what was removed. Once a ticket is closed, redacting its attachments is no longer possible. + + Also, if you want to redact an inline attachment, you can use the `include_inline_images` parameter in the [List Comments](/api-reference/ticketing/tickets/ticket_comments/#list-comments) operation to obtain the inline attachment ID, and use it in the request URL. + + #### Allowed For + + * Admins + * Agents when [deleting tickets is enabled for agents on professional accounts](https://support.zendesk.com/hc/en-us/articles/360002128107) + * Agents assigned to a custom role with permissions to redact ticket content (Enterprise only) + responses: + "200": + description: OK response + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentResponse' + examples: + default: + $ref: '#/components/examples/AttachmentResponseExample' + /api/v2/tickets/{ticket_id}/comments/{ticket_comment_id}/make_private: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketCommentId' + put: + operationId: MakeTicketCommentPrivate + tags: + - Ticket Comments + summary: Make Comment Private + description: | + #### Allowed For + + * Agents + responses: + "200": + description: description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/tickets/{ticket_id}/comments/{ticket_comment_id}/redact: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketCommentId' + put: + operationId: RedactStringInComment + tags: + - Ticket Comments + summary: Redact String in Comment + description: | + Permanently removes words or strings from a ticket comment. Specify the string to redact in an object with a `text` property. Example: `'{"text": "987-65-4320"}'`. The characters of the word or string are replaced by the ▇ symbol. + + If the comment was made by email, the endpoint also attempts to redact the string from the original email retained by Zendesk for audit purposes. + + **Note**: If you use the rich text editor, support for redacting formatted text (bold, italics, hyperlinks) is limited. + + Redaction is permanent. You can't undo the redaction or see *what* was removed. Once a ticket is closed, you can no longer redact strings from its comments. + + To use this endpoint, the "Agents can delete tickets" option must be enabled in the Zendesk Support admin interface at **Admin** > **Settings** > **Agents**. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentResponse' + examples: + default: + $ref: '#/components/examples/TicketCommentStringRedactResponseExample' + /api/v2/tickets/{ticket_id}/comments/count: + get: + operationId: CountTicketComments + tags: + - Ticket Comments + summary: Count Ticket Comments + description: |- + Returns an approximate count of the comments added to the ticket. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Count of ticket comments + content: + application/json: + schema: + $ref: '#/components/schemas/TicketCommentsCountResponse' + examples: + default: + $ref: '#/components/examples/TicketCommentsCountResponseExample' + /api/v2/tickets/{ticket_id}/conversation_log: + get: + operationId: ListConversationLogForTicket + tags: + - Conversation Log + summary: List Conversation log for Ticket + description: | + Lists the conversation log events for a specified ticket. + + #### Pagination + + - Cursor pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed for + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationLogResponse' + examples: + default: + $ref: '#/components/examples/ConversationLogResponseExample' + /api/v2/tickets/{ticket_id}/email_ccs: + get: + operationId: ListTicketEmailCCs + tags: + - Tickets + summary: List Email CCs for a Ticket + description: |- + Returns any users cc'd on the ticket. + + #### Availability + + The [CCs and Followers](https://support.zendesk.com/hc/en-us/articles/203690846) feature must be enabled in Zendesk Support. + + If the feature is not enabled, the default CC functionality is used. In that case, use [List Collaborators](/api-reference/ticketing/tickets/tickets/#list-collaborators-for-a-ticket) to list the users cc'ed on the ticket. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketEmailCCsResponse' + examples: + default: + $ref: '#/components/examples/ListTicketEmailCCsResponseExample' + /api/v2/tickets/{ticket_id}/followers: + get: + operationId: ListTicketFollowers + tags: + - Tickets + summary: List Followers for a Ticket + description: |- + Returns any users who follow the ticket. + + #### Availability + + The [CCs and Followers](https://support.zendesk.com/hc/en-us/articles/203690846) feature must be enabled in Zendesk Support. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketFollowersResponse' + examples: + default: + $ref: '#/components/examples/ListTicketFollowersResponseExample' + /api/v2/tickets/{ticket_id}/incidents: + get: + operationId: ListTicketIncidents + tags: + - Tickets + summary: List Ticket Incidents + description: |- + #### Allowed For + + * Agents + + #### Pagination + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ListTicketIncidentsResponse' + examples: + default: + $ref: '#/components/examples/ListTicketIncidentsResponseExample' + /api/v2/tickets/{ticket_id}/macros/{macro_id}/apply: + parameters: + - $ref: '#/components/parameters/MacroId' + - name: ticket_id + in: path + description: The ID of the ticket + required: true + schema: + type: integer + example: 35436 + get: + operationId: ShowTicketAfterChanges + tags: + - Macros + summary: Show Ticket After Changes + description: | + Returns the full ticket object as it would be after applying the macro to the ticket. + It doesn't actually change the ticket. + + To get only the ticket fields that would be changed by the macro, + see [Show Changes to Ticket](#show-changes-to-ticket). + + #### Allowed For + + * Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/MacroApplyTicketResponse' + examples: + default: + $ref: '#/components/examples/MacroChangesToTicketsResponseExample' + /api/v2/tickets/{ticket_id}/mark_as_spam: + put: + operationId: MarkTicketAsSpamAndSuspendRequester + tags: + - Tickets + summary: Mark Ticket as Spam and Suspend Requester + description: |- + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: string + example: "" + example: "" + /api/v2/tickets/{ticket_id}/merge: + post: + operationId: MergeTicketsIntoTargetTicket + tags: + - Tickets + summary: Merge Tickets into Target Ticket + description: |- + Merges one or more tickets into the ticket with the specified id. + + See [Merging tickets](https://support.zendesk.com/hc/en-us/articles/203690916) + in the Support Help Center for ticket merging rules. + + Any attachment to the source ticket is copied to the target ticket. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Agents + + Agents in the Enterprise account must have merge permissions. + See [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026) + in the Support Help Center. + + #### Available parameters + + The request takes a data object with the following properties: + + | Name | Type | Required | Comments | + | ------------------------ | ------- | -------- | ------------------------------------------------------- | + | ids | array | yes | Ids of tickets to merge into the target ticket | + | target_comment | string | no | Private comment to add to the target ticket. This comment is optional but strongly recommended | + | source_comment | string | no | Private comment to add to the source ticket. This comment is optional but strongly recommended | + | target_comment_is_public | boolean | no | Whether comments in the target ticket are public or private | + | source_comment_is_public | boolean | no | Whether comments in the source tickets are public or private | + + `target_comment` and `source_comment` can be used to provide a reason for the merge for recordkeeping purposes. If the source ticket has attachments, they are included in `target_comment`. + + Comments are private and can't be modified in the following cases: + + * Any of the sources or target tickets are private + * Any of the sources or target tickets were created through X (formerly Twitter), Facebook or the Channel framework + + In any other case, comments default to private but can be modified with the comment privacy parameters. + parameters: + - $ref: '#/components/parameters/TicketId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketMergeInput' + examples: + default: + $ref: '#/components/examples/TicketMergeInputExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/tickets/{ticket_id}/metrics: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ShowTicketMetricsByTicket + tags: + - Ticket Metrics + - Tickets + summary: Show Ticket Metrics By Ticket + description: | + Returns the metrics for a specific ticket. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketMetricsByTicketMetricIdResponse' + examples: + default: + $ref: '#/components/examples/TicketMetricResponseExample' + /api/v2/tickets/{ticket_id}/related: + get: + operationId: TicketRelatedInformation + tags: + - Tickets + summary: Ticket Related Information + description: |- + The request returns a data object with the following properties: + + | Name | Type | Comment + | ------------------- | ------- | ------- + | topic_id | string | Related topic in the Web portal (deprecated feature) + | jira_issue_ids | array | Array of associated jira issues + | followup_source_ids | array | Sources to follow up + | from_archive | boolean | Is true if the current ticket is archived + | incidents | integer | A count of related incident occurrences + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketId' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketRelatedInformation' + examples: + default: + $ref: '#/components/examples/TicketRelatedInformationExample' + /api/v2/tickets/{ticket_id}/satisfaction_rating: + parameters: + - name: ticket_id + in: path + description: The id of the ticket + required: true + schema: + type: integer + example: 35436 + post: + operationId: CreateTicketSatisfactionRating + tags: + - Satisfaction Ratings + summary: Create a Satisfaction Rating + description: | + Creates a CSAT rating for a solved ticket, or for a ticket that was previously + solved and then reopened. + + Only the end user listed as the ticket requester can create a satisfaction rating for the ticket. + + Only "good" and "bad" are valid values for the score when creating a rating. Other states, like "offered", are not valid and will result in a 422 error. + + #### Allowed For + + * End user who requested the ticket + + The end user must be a verified user. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SatisfactionRatingResponse' + examples: + default: + $ref: '#/components/examples/SatisfactionRatingResponseExample' + /api/v2/tickets/{ticket_id}/skips: + parameters: + - $ref: '#/components/parameters/TicketId' + - $ref: '#/components/parameters/TicketSortOrder' + get: + operationId: ListTicketSkipsByTicket + tags: + - Ticket Skips + - Tickets + summary: List Ticket Skips By Ticket + description: | + Returns the skips for a specific ticket. + + Archived tickets are not included in the response. See + [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756) in + the Support Help Center. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + * Agents with "View only" or higher reports permissions in Support. + These permissions are distinct from Explore permissions. + * Agents retrieving their own skips + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketSkipsResponse' + examples: + default: + $ref: '#/components/examples/TicketSkipResponseExample' + /api/v2/tickets/{ticket_id}/tags: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ListResourceTags + tags: + - Tags + summary: List Resource Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + post: + operationId: SetTagsTicket + tags: + - Tags + summary: Set Tags + description: | + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + put: + operationId: PutTagsTicket + tags: + - Tags + summary: Add Tags + description: | + You can also add tags to multiple tickets with the [Update Many + Tickets](/api-reference/ticketing/tickets/tickets/#update-many-tickets) endpoint. + + #### Safe Update + + If the same ticket is updated by multiple API requests at + the same time, some tags could be lost because of ticket + update collisions. Include `updated_stamp` and `safe_update` + properties in the request body to make a safe update. + + For `updated_stamp`, retrieve and specify the ticket's + latest `updated_at` timestamp. The tag update only occurs + if the `updated_stamp` timestamp matches the ticket's + actual `updated_at` timestamp at the time of the request. + If the timestamps don't match (in other words, if the + ticket was updated since you retrieved the ticket's + last `updated_at` timestamp), the request returns a + 409 Conflict error. + + #### Example + + ```js + { + "tags": ["customer"], + "updated_stamp":"2019-09-12T21:45:16Z", + "safe_update":"true" + } + ``` + + For details, see [Protecting against ticket update collisions](/api-reference/ticketing/tickets/tickets/#protecting-against-ticket-update-collisions). + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + delete: + operationId: DeleteTagsTicket + tags: + - Tags + summary: Remove Tags + description: | + You can also delete tags from multiple tickets with the + [Update Many Tickets](/api-reference/ticketing/tickets/tickets/#update-many-tickets) endpoint. + + This endpoint supports safe updates. See [Safe Update](/api-reference/ticketing/ticket-management/tags/#safe-update). + + #### Allowed For + + * Agents + parameters: + - name: tags + in: query + description: Comma-separated list of tags to remove from the ticket. + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsRemoveResponseExample' + /api/v2/tickets/{ticket_id}/task_lists: + parameters: + - $ref: '#/components/parameters/TicketId' + get: + operationId: ShowTaskList + tags: + - Task Lists + summary: Show Task List + description: | + Returns the task list attached to the specified ticket. If the ticket doesn't have a task list, an empty array is returned. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListByTicketIdResponse' + examples: + default: + $ref: '#/components/examples/TaskListByTicketIdResponseExample' + post: + operationId: CreateTaskList + tags: + - Task Lists + summary: Create Task List + description: |- + Adds a task list to the specified ticket. + + #### Allowed For + + * Agents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListCreateRequest' + examples: + default: + $ref: '#/components/examples/TaskListCreateRequestExample' + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListByTicketIdResponse' + examples: + default: + $ref: '#/components/examples/TaskListByTicketIdResponseExample' + /api/v2/tickets/count: + get: + operationId: CountTickets + tags: + - Tickets + summary: Count Tickets + description: |- + Returns an approximate count of tickets in the account. If the count exceeds 100,000, it is updated every 24 hours. + + `ccd` lists tickets that the specified user is cc'd on. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of tickets + content: + application/json: + schema: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + examples: + default: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + /api/v2/tickets/create_many: + post: + operationId: TicketsCreateMany + tags: + - Tickets + summary: Create Many Tickets + description: |- + Accepts an array of up to 100 ticket objects. **Note**: Every ticket created with this endpoint may be affected by your business rules, which can include sending email notifications to your end users. If you are importing historical tickets or creating more than 1000 tickets, consider using the [Ticket Bulk Import](/api-reference/ticketing/tickets/ticket_import/#ticket-bulk-import) endpoint. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + * Agents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsCreateRequest' + examples: + default: + $ref: '#/components/examples/TicketsCreateRequestExample' + responses: + "200": + description: Create many tickets + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/tickets/destroy_many: + delete: + operationId: BulkDeleteTickets + tags: + - Tickets + summary: Bulk Delete Tickets + description: |- + Accepts a comma-separated list of up to 100 ticket ids. + + #### Allowed For + + * Admins + * Agents with permission to delete tickets + + Agent delete permissions are set in Support. See + [Deleting tickets](https://support.zendesk.com/hc/en-us/articles/203690936) + in the Support Help Center. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + parameters: + - $ref: '#/components/parameters/TicketIds' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/tickets/mark_many_as_spam: + put: + operationId: MarkManyTicketsAsSpam + tags: + - Tickets + summary: Bulk Mark Tickets as Spam + description: |- + Accepts a comma-separated list of up to 100 ticket ids. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/TicketIds' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/tickets/recent: + get: + operationId: ListRecentTickets + tags: + - Tickets + summary: List Recent Tickets + description: |- + Lists tickets that the requesting agent recently viewed in the agent interface, not recently created or updated tickets. + + #### Allowed For + * Agents + responses: + "200": + description: List recently viewed tickets + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/tickets/show_many: + get: + operationId: TicketsShowMany + tags: + - Tickets + summary: Show Multiple Tickets + description: |- + Accepts a comma-separated list of ticket ids to return. + + This endpoint will return up to 100 tickets records. + + #### Allowed For + * Agents + parameters: + - $ref: '#/components/parameters/TicketIds' + - name: include + in: query + description: | + A comma-separated list of sideloads to include. + schema: + type: string + responses: + "200": + description: List tickets + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/tickets/update_many: + put: + operationId: TicketsUpdateMany + tags: + - Tickets + summary: Update Many Tickets + description: Accepts an array of up to 100 ticket objects, or a comma-separated list of up to 100 ticket ids. + parameters: + - name: ids + in: query + description: Comma-separated list of ticket ids + schema: + type: string + example: 35436,35437 + requestBody: + description: Ticket object for bulk updates (with ids query parameter) or array of ticket objects for batch updates + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsUpdateRequest' + examples: + batch_update: + $ref: '#/components/examples/TicketsUpdateRequestBatchUpdateExample' + bulk_update_tags: + $ref: '#/components/examples/TicketsUpdateRequestBulkUpdateTagsExample' + default: + $ref: '#/components/examples/TicketsUpdateRequestDefaultExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/trigger_categories: + get: + operationId: ListTriggerCategories + tags: + - Trigger Categories + summary: List Ticket Trigger Categories + description: | + Returns all the ticket trigger categories in the account. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: page + in: query + description: Pagination parameters + style: deepObject + explode: true + schema: + type: object + properties: + after: + type: string + before: + type: string + size: + type: integer + example: + after: eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9 + before: eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9 + size: 50 + - name: sort + in: query + description: Sort parameters + schema: + type: string + enum: + - position + - -position + - name + - -name + - created_at + - -created_at + - updated_at + - -updated_at + - name: include + in: query + description: Allowed sideloads + schema: + type: string + enum: + - rule_counts + responses: + "200": + description: A paged array of ticket trigger categories + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TriggerCategoriesResponse' + - $ref: '#/components/schemas/Pagination' + example: + links: + next: https://{subdomain}.zendesk.com/api/v2/trigger_categories?include=rule_counts&page[after]=eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9&page[size]=2&sort=position + prev: https://{subdomain}.zendesk.com/api/v2/trigger_categories?include=rule_counts&page[before]=eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9&page[size]=2&sort=position + meta: + after_cursor: eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9 + before_cursor: eyJvIjoiLXNjb3JlLGlkIiwidiI6ImFRSUFBQUFBQUFBQWFRMHBJUUVBQUFBQSJ9 + has_more: true + trigger_categories: + - created_at: "2020-07-17T01:30:07Z" + id: "10001" + name: Email Triggers + position: 0 + updated_at: "2020-07-17T01:30:07Z" + - created_at: "2020-07-17T01:30:07Z" + id: "10002" + name: SMS Triggers + position: 1 + updated_at: "2020-07-17T01:30:07Z" + "400": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: InvalidPaginationParameter + title: page[after] is not valid + "403": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoriesNotEnabled + title: Ticket trigger categories are not enabled for your account + post: + operationId: CreateTriggerCategory + tags: + - Trigger Categories + summary: Create Ticket Trigger Category + description: Creates a ticket trigger category. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + trigger_category: + type: object + properties: + name: + type: string + position: + type: integer + format: int64 + required: + - name + example: + trigger_category: + name: All Notification Triggers + position: 0 + responses: + "200": + description: The created ticket trigger category + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerCategoryResponse' + example: + trigger_category: + created_at: "2020-07-17T01:30:07Z" + id: "10001" + name: All Notification Triggers + position: 0 + updated_at: "2020-07-17T01:30:07Z" + "400": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: InvalidTriggerCategory + title: Name cannot be blank + "403": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoriesNotEnabled + title: Ticket trigger categories are not enabled for your account + - code: ProductLimitExceeded + title: Your account has reached the limit of 500 ticket trigger categories. + /api/v2/trigger_categories/{trigger_category_id}: + get: + operationId: ShowTriggerCategoryById + tags: + - Trigger Categories + summary: Show Ticket Trigger Category + description: Returns the ticket trigger category with the specified ID. + parameters: + - name: trigger_category_id + in: path + description: The id of the ticket trigger category to retrieve + required: true + schema: + type: string + example: "10001" + responses: + "200": + description: The requested ticket trigger category + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerCategoryResponse' + example: + trigger_category: + created_at: "2020-07-17T01:30:07Z" + id: "10001" + name: All Notification Triggers + position: 0 + updated_at: "2020-07-17T01:30:07Z" + "404": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoryNotFound + title: Category can’t be found. Check the ID and try again. + patch: + operationId: UpdateTriggerCategory + tags: + - Trigger Categories + summary: Update Ticket Trigger Category + description: Updates the ticket trigger category with the specified ID. + parameters: + - name: trigger_category_id + in: path + description: The id of the ticket trigger category to update + required: true + schema: + type: string + example: "10001" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + trigger_category: + $ref: '#/components/schemas/TriggerCategoryRequest' + example: + trigger_category: + name: All Notification Triggers Updated + position: 10 + responses: + "200": + description: The updated trigger category + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerCategoryResponse' + example: + trigger_category: + created_at: "2020-07-17T01:30:07Z" + id: "10001" + name: All Notification Triggers Updated + position: 10 + updated_at: "2020-07-18T05:23:32Z" + "400": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: InvalidTriggerCategory + title: Name cannot be blank + "404": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoryNotFound + title: Category can’t be found. Check the ID and try again. + delete: + operationId: DeleteTriggerCategory + tags: + - Trigger Categories + summary: Delete Ticket Trigger Category + description: Deletes the ticket trigger category with the specified ID. + parameters: + - name: trigger_category_id + in: path + description: The id of the ticket trigger category to delete + required: true + schema: + type: string + example: "10001" + responses: + "204": + description: No content + "400": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoryNotEmpty + title: A category with active ticket triggers cannot be deleted. + "404": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + example: + errors: + - code: TriggerCategoryNotFound + title: Category can’t be found. Check the ID and try again. + /api/v2/trigger_categories/jobs: + post: + operationId: BatchOperateTriggerCategories + tags: + - Trigger Categories + summary: Create Batch Job for Ticket Trigger Categories + description: Creates a job that performs a batch operation for the given ticket trigger categories. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJobRequest' + example: + job: + action: patch + items: + trigger_categories: + - id: "10001" + position: 0 + - id: "10002" + position: 1 + triggers: + - active: false + category_id: "10001" + id: "10011" + position: 10 + - active: true + category_id: "10002" + id: "10012" + position: 1 + responses: + "200": + description: The response to the batch job + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJobResponse' + example: + results: + trigger_categories: + - created_at: "2020-07-18T01:24:53Z" + id: "10001" + name: Notifications + position: 0 + updated_at: "2020-07-20T01:30:07Z" + - created_at: "2020-07-17T06:31:12Z" + id: "10002" + name: Apply Tags + position: 1 + updated_at: "2020-07-20T01:30:07Z" + triggers: + - actions: + - { } + active: true + conditions: { } + created_at: "2012-09-25T22:50:26Z" + description: Notify external target + id: 10012 + position: 1 + raw_title: Notify target + title: Notify Target + updated_at: "2020-07-20T01:30:07Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/10012 + - actions: + - { } + active: false + conditions: { } + created_at: "2012-09-25T22:50:26Z" + description: Close and save a ticket + id: 10011 + position: 10 + raw_title: Close and Save + title: Close and Save + updated_at: "2020-07-20T01:30:07Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/10011 + status: complete + "400": + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJobResponse' + example: + errors: + - code: InvalidTrigger + title: category_id is not valid + trigger_id: "10001" + status: failed + /api/v2/triggers: + get: + operationId: ListTriggers + tags: + - Triggers + summary: List Ticket Triggers + description: | + Lists all ticket triggers for the current account. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported. The usage sideloads are only supported on the Support Professional or Suite Growth plan or above. + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each trigger, if present + | permissions | The permissions for each trigger + | usage_1h | The number of times each trigger has been used in the past hour + | usage_24h | The number of times each trigger has been used in the past day + | usage_7d | The number of times each trigger has been used in the past week + | usage_30d | The number of times each trigger has been used in the past thirty days + parameters: + - $ref: '#/components/parameters/TriggerActive' + - $ref: '#/components/parameters/TriggerSort' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + - $ref: '#/components/parameters/TriggerCategoryId' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/TriggerInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggersResponse' + examples: + default: + $ref: '#/components/examples/TriggersResponseExample' + post: + operationId: CreateTrigger + tags: + - Triggers + summary: Create Trigger + description: | + #### Allowed For + + * Agents + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWithCategoryRequest' + examples: + default: + $ref: '#/components/examples/TriggerWithCategoryRequestExample' + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerResponse' + examples: + default: + $ref: '#/components/examples/TriggerResponseExample' + /api/v2/triggers/{trigger_id}: + parameters: + - $ref: '#/components/parameters/TriggerId' + get: + operationId: GetTrigger + tags: + - Triggers + summary: Show Ticket Trigger + description: | + #### Allowed For + + * Agents + + The Via Type value is a number instead of a text string. See [Via types reference](/documentation/ticketing/reference-guides/via-types/) for the keys. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerResponse' + examples: + default: + $ref: '#/components/examples/TriggerResponseExample' + put: + operationId: UpdateTrigger + tags: + - Triggers + summary: Update Ticket Trigger + description: | + #### Allowed For + + * Agents + + #### Note + + Updating a condition or action updates both the conditions and actions arrays, + clearing all existing values of both arrays. Include all your conditions + and actions when updating any condition or action. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWithCategoryRequest' + examples: + default: + $ref: '#/components/examples/TriggerWithCategoryRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerResponse' + examples: + default: + $ref: '#/components/examples/TriggerResponseExample' + delete: + operationId: DeleteTrigger + tags: + - Triggers + summary: Delete Ticket Trigger + description: | + #### Allowed For + + * Agents + responses: + "204": + description: No Content response + /api/v2/triggers/{trigger_id}/revisions: + parameters: + - $ref: '#/components/parameters/TriggerId' + get: + operationId: ListTriggerRevisions + tags: + - Triggers + summary: List Ticket Trigger Revisions + description: | + List the revisions associated with a ticket trigger. Ticket trigger revision history is only available on Enterprise plans. + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ----- | ------------- + | users | The user that authored each revision + + #### Pagination + + This endpoint uses cursor-based pagination. The records are ordered in + descending order by the `created_at` timestamp, then by `id` on duplicate + `created_at` values. + + The `cursor` parameter is a non-human-readable argument you can use to move + forward or backward in time. + + Each JSON response will contain the following attributes to help you get + more results: + + - `after_url` requests more recent results + - `before_url` requests older results + - `after_cursor` is the cursor to build the request yourself + - `before_cursor` is the cursor to build the request yourself + + The properties are null if no more records are available. + + You can request a maximum of 1000 records using the `limit` parameter. If + no `limit` parameter is supplied, it will default to 1,000. + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRevisionsResponse' + examples: + default: + $ref: '#/components/examples/TriggerRevisionsResponseExample' + /api/v2/triggers/{trigger_id}/revisions/{trigger_revision_id}: + parameters: + - $ref: '#/components/parameters/TriggerId' + - $ref: '#/components/parameters/TriggerRevisionId' + get: + operationId: TriggerRevision + tags: + - Triggers + summary: Show Ticket Trigger Revision + description: | + Fetches a revision associated with a ticket trigger. Ticket trigger revision history is only available on Enterprise plans. + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ----- | ------------- + | users | The user that authored each revision + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRevisionResponse' + examples: + default: + $ref: '#/components/examples/TriggerRevisionResponseExample' + /api/v2/triggers/active: + parameters: + - $ref: '#/components/parameters/TriggerSort' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + - $ref: '#/components/parameters/TriggerCategoryId' + get: + operationId: ListActiveTriggers + tags: + - Triggers + summary: List Active Ticket Triggers + description: | + Lists all active ticket triggers. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each ticket trigger, if present + | permissions | The permissions for each trigger + | usage_1h | The number of times each ticket trigger has been used in the past hour + | usage_24h | The number of times each ticket trigger has been used in the past day + | usage_7d | The number of times each ticket trigger has been used in the past week + | usage_30d | The number of times each ticket trigger has been used in the past thirty days + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggersResponse' + examples: + default: + $ref: '#/components/examples/TriggersActiveResponseExample' + /api/v2/triggers/definitions: + get: + operationId: ListTriggerActionConditionDefinitions + tags: + - Triggers + summary: List Ticket Trigger Action and Condition Definitions + description: | + Returns the definitions of the actions a ticket trigger can perform and the + definitions of the conditions under which a ticket trigger can execute. The + definition of the action includes a title ("Status"), a type ("list"), and + possible values. The definition of the condition includes the same fields + as well as the possible operators. + + For a list of supported actions, see the [Actions reference](/documentation/ticketing/reference-guides/actions-reference) + For a list of supported conditions, see the [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerDefinitionResponse' + examples: + default: + $ref: '#/components/examples/TriggerDefinitionResponseExample' + /api/v2/triggers/destroy_many: + parameters: + - $ref: '#/components/parameters/TriggerIds' + delete: + operationId: DeleteManyTriggers + tags: + - Triggers + summary: Bulk Delete Ticket Triggers + description: | + Deletes the ticket triggers corresponding to the provided comma-separated list of IDs. + + #### Allowed For + + * Agents + + #### Request Parameters + + The DELETE request takes one parameter, an `ids` object that lists the + ticket triggers to delete. + + | Name | Description + | ---- | ----------- + | ids | The IDs of the triggers to delete + + #### Example request + + ```js + { + "ids": "25,23,27,22" + } + ``` + responses: + "204": + description: No content response + /api/v2/triggers/reorder: + put: + operationId: ReorderTriggers + tags: + - Triggers + summary: Reorder Ticket Triggers + description: | + Alters the firing order of ticket triggers in the account. See + [Reordering and sorting triggers](https://support.zendesk.com/hc/en-us/articles/115015696088) + in the Zendesk Help Center. The firing order is set in a `trigger_ids` array in the request body. + + You must include every ticket trigger id in your account to reorder the ticket triggers. If not, the endpoint will return 404 Forbidden. + + Reordering ticket triggers via the API is not permitted if you have more than one ticket trigger category. If there is more than one + ticket trigger category, the endpoint will return a `LimitOneCategory` error. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerResponse' + examples: + default: + $ref: '#/components/examples/TriggerResponseExample' + /api/v2/triggers/search: + parameters: + - $ref: '#/components/parameters/TriggerSearchQuery' + - $ref: '#/components/parameters/TriggerSearchFilter' + - $ref: '#/components/parameters/TriggerActive' + - $ref: '#/components/parameters/TriggerSort' + - $ref: '#/components/parameters/TriggerSortBy' + - $ref: '#/components/parameters/TriggerSortOrder' + - $ref: '#/components/parameters/TriggerInclude' + get: + operationId: SearchTriggers + tags: + - Triggers + summary: Search Ticket Triggers + description: | + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported. For more information, see [Side-loading](/documentation/ticketing/using-the-zendesk-api/side_loading/). + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each ticket trigger, if present + | permissions | The permissions for each ticket trigger + | usage_1h | The number of times each ticket trigger has been used in the past hour + | usage_24h | The number of times each ticket trigger has been used in the past day + | usage_7d | The number of times each ticket trigger has been used in the past week + | usage_30d | The number of times each ticket trigger has been used in the past thirty days + + #### Filter + + Use the `filter` query parameter to filter a ticket trigger search by one or more attributes. For example, the following `filter` argument filters ticket triggers by the `description` attribute: + + ```json + { + "json": { + "description": "Close a ticket" + } + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggersResponse' + examples: + default: + $ref: '#/components/examples/TriggersSearchResponseExample' + /api/v2/triggers/update_many: + put: + operationId: UpdateManyTriggers + tags: + - Triggers + summary: Update Many Ticket Triggers + description: | + Updates the position or the active status of multiple ticket triggers. Any additional properties are ignored. + + #### Allowed For + + * Agents + + #### Request Parameters + + The PUT request expects a `triggers` object that lists the ticket triggers to update. + + Each ticket trigger may have the following properties: + + | Name | Mandatory | Description + | -------- | --------- | ----------- + | id | yes | The ID of the ticket trigger to update + | position | no | The new position of the ticket trigger + | active | no | The active status of the ticket trigger (true or false) + | category_id | no | The ID of the new category the ticket trigger is to be moved to + + #### Example Request + + ```js + { + "triggers": [ + {"id": 25, "position": 3}, + {"id": 23, "position": 5}, + {"id": 27, "position": 9}, + {"id": 22, "position": 7} + ] + } + ``` + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerBulkUpdateRequest' + examples: + default: + $ref: '#/components/examples/TriggerBulkUpdateRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TriggersResponse' + examples: + default: + $ref: '#/components/examples/TriggersResponseExample' + /api/v2/uploads: + post: + operationId: UploadFiles + tags: + - Attachments + summary: Upload Files + description: | + Uploads a file that can be attached to a ticket comment. It doesn't attach the file to the comment. For details and examples, see [Attaching ticket comments with the API](/documentation/ticketing/managing-tickets/adding-ticket-attachments-with-the-api/). + + The endpoint has a required `filename` query parameter. The parameter specifies what the file will be named when attached to the ticket comment (to give the agent more context about the file). The parameter does not specify the file on the local system to be uploaded. While the two names can be different, their file extensions must be the same. If they don't match, the agent's browser or file reader could give an error when attempting to open the attachment. + + The `Content-Type` header must contain a recognized MIME type that correctly describes the type of the uploaded file. Failing to send a recognized, correct type may cause undesired behavior. For example, in-browser audio playback may be interrupted by the browser's security mechanisms for MP3s uploaded with an incorrect type. + + Adding multiple files to the same upload is handled by splitting requests and passing the API token received from the first request to each subsequent request. The token is valid for 60 minutes. + + **Note**: Even if [private attachments](https://support.zendesk.com/hc/en-us/articles/204265396) are enabled in the Zendesk Support instance, uploaded files are visible to any authenticated user at the `content_URL` specified in the [JSON response](#json-format) until the upload token is consumed. Once a file is associated with a ticket or post, visibility is restricted to users with access to the ticket or post with the attachment. + + #### Allowed For + + * End users + parameters: + - name: filename + in: query + description: The name to assign to the uploaded file + required: true + schema: + type: string + example: my_document.pdf + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/AttachmentUploadResponse' + examples: + default: + $ref: '#/components/examples/AttachmentUploadResponseExample' + /api/v2/uploads/{token}: + delete: + operationId: DeleteUpload + tags: + - Attachments + summary: Delete Upload + description: | + #### Allowed for + + * End Users + parameters: + - name: token + in: path + description: The token of the uploaded attachment + required: true + schema: + type: string + example: 6bk3gql82em5nmf + responses: + "204": + description: No Content response + /api/v2/user_fields: + get: + operationId: ListUserFields + tags: + - User Fields + summary: List User Fields + description: | + Returns a list of custom user fields in your account. Fields are returned in the order that you specify in your user fields configuration in Zendesk Support. Clients should cache this resource for the duration of their API usage and map the key for each User Field to the values returned under the `user_fields` attribute on the [User](/api-reference/ticketing/users/users/) resource. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/CursorPaginationPage' + - name: resolve_dc + in: query + description: If true, resolves dynamic content placeholders. + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserFieldsResponse' + examples: + default: + $ref: '#/components/examples/UserFieldsResponseExample' + post: + operationId: CreateUserField + tags: + - User Fields + summary: Create User Field + description: | + Creates any of the following custom field types: + + * text (default when no "type" is specified) + * textarea + * checkbox + * date + * integer + * decimal + * regexp + * dropdown + * lookup + * multiselect + + See [About custom field types](https://support.zendesk.com/hc/en-us/articles/203661866) in Zendesk help. + + #### Allowed For + + * Admins + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/UserFieldResponse' + examples: + default: + $ref: '#/components/examples/UserFieldCreateResponseExample' + /api/v2/user_fields/{user_field_id}: + parameters: + - $ref: '#/components/parameters/UserFieldId' + get: + operationId: ShowUserField + tags: + - User Fields + summary: Show User Field + description: | + #### Allowed for + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserFieldResponse' + examples: + default: + $ref: '#/components/examples/UserFieldResponseExample' + put: + operationId: UpdateUserField + tags: + - User Fields + summary: Update User Field + description: | + #### Updating a Dropdown (Tagger) or Multiselect Field + + Dropdown and multiselect fields return an array of `custom_field_options` which specify the name, value, and order of the list of dropdown or multiselect options. + Understand the following behavior when updating a dropdown or multiselect field: + + - All options must be passed on update. Options that are not passed will be removed. As a result, these values will be removed from any organizations. + - To create a new option, pass a null `id` along with `name` and `value`. + - To update an existing option, pass its `id` along with `name` and `value`. + - To re-order an option, reposition it in the `custom_field_options` array relative to the other options. + - To remove an option, omit it from the list of options upon update. + + #### Example Request + + ```bash + curl https://{subdomain}.zendesk.com/api/v2/user_fields/{user_field_id} \ + -H "Content-Type: application/json" -X PUT \ + -d '{"user_field": {"custom_field_options": [{"id": 124, "name": "Option 2", "value": "option_2"}, {"id": 123, "name": "Option 1", "value": "option_1"}, {"id": 125, "name": "Option 2", "value": "option_3"}]}}' \ + -v -u {email_address}/token:{api_token} + ``` + #### Allowed for + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserFieldResponse' + examples: + default: + $ref: '#/components/examples/UserFieldUpdateResponseExample' + delete: + operationId: DeleteUserField + tags: + - User Fields + summary: Delete User Field + description: | + #### Allowed for + + * Admins + responses: + "204": + description: No Content response + /api/v2/user_fields/{user_field_id}/options: + parameters: + - $ref: '#/components/parameters/UserFieldId' + get: + operationId: ListUserFieldOptions + tags: + - User Fields + summary: List User Field Options + description: | + Returns a list of custom user field options for the given dropdown user field. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionsResponse' + examples: + default: + $ref: '#/components/examples/CustomUserFieldOptionsResponseExample' + post: + operationId: CreateOrUpdateUserFieldOption + tags: + - User Fields + summary: Create or Update a User Field Option + description: | + Creates a new option or updates an existing option for the given drop-down user field. + + To update an option, include the id of the option in the `custom_field_option` object. Example: `{"custom_field_option": {"id": 10002, "name": "Pineapples", ... }`. If an option exists for the given ID, the option will be updated. Otherwise, a new option will be created. + + #### Response + + Returns one of the following status codes: + + - 200 with `Location: /api/v2/user_fields/{user_field_id}/options` if the user field option already exists in the database + - 201 with `Location: /api/v2/user_fields/{user_field_id}/options` if the user field option is new + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomUserFieldOptionUpdateResponseExample' + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomUserFieldOptionCreateResponseExample' + /api/v2/user_fields/{user_field_id}/options/{user_field_option_id}: + parameters: + - $ref: '#/components/parameters/UserFieldId' + - $ref: '#/components/parameters/UserFieldOptionId' + get: + operationId: ShowUserFieldOption + tags: + - User Fields + summary: Show a User Field Option + description: | + #### Allowed for + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldOptionResponse' + examples: + default: + $ref: '#/components/examples/CustomUserFieldOptionResponseExample' + delete: + operationId: DeleteUserFieldOption + tags: + - User Fields + summary: Delete User Field Option + description: | + #### Allowed for + * Admins + responses: + "204": + description: No Content response + /api/v2/user_fields/reorder: + put: + operationId: ReorderUserField + tags: + - User Fields + summary: Reorder User Field + description: | + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/user_fields/show_many: + get: + operationId: ShowManyUserFields + tags: + - User Fields + summary: Show Many User Fields + description: | + Returns multiple user fields by their keys. + + #### Allowed For + + * Agents + parameters: + - name: keys + in: query + description: | + Comma-separated list of user field keys to retrieve. + schema: + type: string + example: my_field_1,my_field_2 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserFieldsResponse' + examples: + default: + $ref: '#/components/examples/UserFieldsResponseExample' + /api/v2/users: + get: + operationId: ListUsers + tags: + - Users + summary: List Users + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + - $ref: '#/components/parameters/UserExternalIdFilter' + - $ref: '#/components/parameters/UsersInclude' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/UsersResponseExample' + post: + operationId: CreateUser + tags: + - Users + summary: Create User + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRequest' + examples: + default: + $ref: '#/components/examples/UserRequestExample' + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UserCreateResponseExample' + /api/v2/users/{user_id}: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ShowUser + tags: + - Users + summary: Show User + description: | + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/UsersInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UserResponseExample' + put: + operationId: UpdateUser + tags: + - Users + summary: Update User + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateRequest' + examples: + default: + $ref: '#/components/examples/UpdateUserRequestExample' + multipart/form-data: + schema: + type: object + description: Form data for file uploads (e.g., user photo) + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UpdateUserResponseExample' + delete: + operationId: DeleteUser + tags: + - Users + summary: Delete User + description: | + Deletes the user and associated records from the account. + + **Warning**: + + * Deleted users are not recoverable. + * Both agents and administrators can soft delete users in the agent interface in Zendesk Support. Agents with permission can delete end users, while administrators can delete all users except the account owner. + + To comply with GDPR, a further step is needed. See [Permanently Delete User](/api-reference/ticketing/users/users/#permanently-delete-user). + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage end users or team members + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/DeleteUserResponseExample' + /api/v2/users/{user_id}/brand_agents: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserBrandAgents + tags: + - Brand Agents + - Users + summary: List Brand Agent Memberships By User + description: | + Returns a list of all brand agent memberships for a specific user. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Admins + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandAgentsResponse' + examples: + default: + $ref: '#/components/examples/BrandAgentsResponseExample' + /api/v2/users/{user_id}/brand_agents/{brand_agent_id}: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/BrandAgentId' + get: + operationId: ShowUserBrandAgentById + tags: + - Brand Agents + - Users + summary: Show Brand Agent Membership By User + description: | + Returns a specific brand agent membership for a user. + + #### Allowed For + + * Admins + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/BrandAgentResponse' + examples: + default: + $ref: '#/components/examples/BrandAgentResponseExample' + /api/v2/users/{user_id}/compliance_deletion_statuses: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ShowUserComplianceDeletionStatuses + tags: + - Users + summary: Show Compliance Deletion Statuses + description: | + Returns the GDPR status for each user per area of compliance. A Zendesk area of compliance is typically a product like "support/explore" but can be more fine-grained for areas within the product lines. + + If the user is not in the account, the request returns a 404 status. + + ```http + Status: 404 + { + "error":"RecordNotFound", + "description":"Not found" + } + ``` + + #### Allowed For + + * Agents, with restrictions + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: application + in: query + description: Area of compliance + schema: + type: string + example: chat + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ComplianceDeletionStatusesResponse' + examples: + default: + $ref: '#/components/examples/ComplianceDeletionStatusesResponseExample' + /api/v2/users/{user_id}/entitlements/full: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: GetUserEntitlementsFull + tags: + - Users + summary: Get Full User Entitlements + description: | + Returns the full entitlements for all Zendesk products (Explore, Voice, Knowledge, Live Chat) for the specified user. This includes the role name and active status for each product. + + An entitlement is only considered active if both of the following conditions apply: the user has access and the product is active on the account. + + #### Allowed For + + * Agents + + #### OAuth Scopes + + Requires one of the following OAuth scopes: `users:read` or `read` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserEntitlementsFullResponse' + examples: + default: + $ref: '#/components/examples/UserEntitlementsFullResponseExample' + "404": + description: User not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: RecordNotFound + "503": + description: Service unavailable - Too many requests + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: ServiceUnavailable + /api/v2/users/{user_id}/group_memberships: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserGroupMemberships + tags: + - Group Memberships + summary: List Group Memberships by User + description: | + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/GroupMembershipsInclude' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + post: + operationId: CreateUserGroupMembership + tags: + - Group Memberships + - Users + summary: Create Group Membership for User + description: | + Assigns an agent to a given group. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipResponseExample' + /api/v2/users/{user_id}/group_memberships/{group_membership_id}: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/GroupMembershipId' + get: + operationId: ShowUserGroupMembershipById + tags: + - Group Memberships + - Users + summary: Show User's Group Membership + description: | + Returns a specific group membership for a user. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipResponseExample' + delete: + operationId: DeleteUserGroupMembership + tags: + - Group Memberships + - Users + summary: Delete User's Group Membership + description: | + Immediately removes a user from a group and schedules a job to unassign all working tickets that are assigned to the given user and group combination. + + #### Allowed For + + * Admins + * Agents assigned to a custom role with permissions to manage group memberships (Enterprise only) + responses: + "204": + description: No content response + /api/v2/users/{user_id}/group_memberships/{group_membership_id}/make_default: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/GroupMembershipId' + put: + operationId: GroupMembershipSetDefault + tags: + - Group Memberships + summary: Set Membership as Default + description: | + #### Allowed For: + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupMembershipsResponse' + examples: + default: + $ref: '#/components/examples/GroupMembershipsResponseExample' + /api/v2/users/{user_id}/groups: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/ExcludeDeleted' + get: + operationId: ListUserGroups + tags: + - Groups + summary: List User Groups + description: | + Returns a list of groups for the specified user. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupsResponse' + examples: + default: + $ref: '#/components/examples/GroupsResponseExample' + /api/v2/users/{user_id}/groups/count: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: CountUserGroups + tags: + - Groups + summary: Count User Groups + description: | + Returns an approximate count of groups for the specified user. If the count exceeds 100,000, it is updated every 24 hours. + + The `refreshed_at` property of the `count` object is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `refreshed_at` may occasionally be null. This indicates that the count is being updated in the background, and the `value` property of the `count` object is limited to 100,000 until the update is complete. + + #### Allowed For + + * Admins + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/GroupsCountObject' + examples: + default: + $ref: '#/components/examples/GroupsCountResponseExample' + /api/v2/users/{user_id}/identities: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserIdentities + tags: + - User Identities + summary: List Identities + description: | + Returns a list of identities for the given user. + + Use the first endpoint if authenticating as an agent. Use the second if authenticating as an end user. End users can only list email and phone number identities. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page for cursor pagination. + + #### Allowed For + + * Agents + * Verified end users + parameters: + - name: type + in: query + description: Filters results by one or more identity types using the format `?type[]={type}&type[]={type}` + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - agent_forwarding + - any_channel + - email + - facebook + - foreign + - messaging + - microsoft + - phone_number + - sdk + - twitter + - $ref: '#/components/parameters/CursorPaginationPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentitiesResponse' + examples: + default: + $ref: '#/components/examples/UserIdentitiesResponseExample' + post: + operationId: CreateUserIdentity + tags: + - User Identities + summary: Create Identity + description: | + Adds an identity to a user's profile. An agent can add an identity to any user profile. + + Supported identity types: + + | Type | Example | + | ---------------- | ------- | + | email | `{ "type" : "email", "value" : "someone@example.com" }` | + | twitter | `{ "type" : "twitter", "value" : "screen_name" }` | + | facebook | `{ "type" : "facebook", "value" : "855769377321" }` | + | google | `{ "type" : "google", "value" : "example@gmail.com" }` | + | agent_forwarding | `{ "type" : "agent_forwarding", "value" : "+1 555-123-4567" }` | + | phone_number | `{ "type" : "phone_number", "value" : "+1 555-123-4567" }` | + + To create an identity without sending out a verification email, include a `"skip_verify_email": true` property. The `"skip_verify_email": true` property does not apply when updating your own agent profile. A welcome or verification email will be sent regardless of this setting. + + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityCreateResponseExample' + /api/v2/users/{user_id}/identities/{user_identity_id}: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + get: + operationId: ShowUserIdentity + tags: + - User Identities + summary: Show Identity + description: | + Shows the identity with the given id for a given user. + + Use the first endpoint if authenticating as an agent. Use the second if authenticating as an end user. End users can only view email or phone number identity. + + #### Allowed For + + * Agents + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityResponseExample' + put: + operationId: UpdateUserIdentity + tags: + - User Identities + summary: Update Identity + description: | + This endpoint allows you to: + + * Set the specified identity as verified (by setting `verified` to "true" or `verification_method` to "low") + * Unverify a verified identity (by setting `verified` to "false" or `verification_method` to "none") + * Update the `value` property of the specified identity + + You can't change an identity's `primary` attribute with this endpoint. You must use the [Make Identity Primary](#make-identity-primary) endpoint instead. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityUpdateResponseExample' + delete: + operationId: DeleteUserIdentity + tags: + - User Identities + summary: Delete Identity + description: | + Deletes the identity for a given user. + In certain cases, a phone number associated with an identity is still visible on the user profile after the identity has been deleted via API. You can remove the phone number from the user profile by updating the `phone` attribute of the user to an empty string. See [Update User via API](/api-reference/ticketing/users/users/#update-user) for details and examples. + + Deleting identities with type `messaging` could break messaging functionality. For example, an agent may stop being able to send messages via the messaging channel. + + #### Allowed For + * Agents + responses: + "204": + description: No Content response + /api/v2/users/{user_id}/identities/{user_identity_id}/make_primary: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + put: + operationId: MakeUserIdentityPrimary + tags: + - User Identities + summary: Make Identity Primary + description: | + Sets the specified identity as primary. To change other attributes, use the [Update Identity](#update-identity) endpoint. This is a collection-level operation and the correct behavior for an API client is to subsequently reload the entire collection. + + The first endpoint is the preferred option if authenticating as an agent. If authenticating as an end user, you can only use the second endpoint. In addition, an end user can only make an email identity primary if the email is verified. + + #### Allowed For + + * Agents + * Verified end users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentitiesResponse' + examples: + default: + $ref: '#/components/examples/UserIdentitiesResponseExample' + /api/v2/users/{user_id}/identities/{user_identity_id}/request_verification: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + put: + operationId: RequestUserVerfication + tags: + - User Identities + summary: Request User Verification + description: | + Sends the user a verification email with a link to verify ownership of the email address. + + #### Allowed For + + * Agents + responses: + "200": + description: Success description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/users/{user_id}/identities/{user_identity_id}/verify: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/UserIdentityId' + put: + operationId: VerifyUserIdentity + tags: + - User Identities + summary: Verify Identity + description: | + Sets the specified identity as verified. + + For security reasons, you can't use this endpoint to update the email identity of the account owner. To verify the person's identity, send a verification email. See [Verifying the account owner's email address](https://support.zendesk.com/hc/en-us/articles/4408828975130) in Zendesk help. + + If [automatic mapping of users to organizations using the email domain](https://support.zendesk.com/hc/en-us/articles/4408882246298-Creating-organizations#topic_nxl_vdt_bc) is enabled and the user is not already a member of an organization, they will be automatically added to the organization associated with the email domain once the email identity is verified. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityResponse' + examples: + default: + $ref: '#/components/examples/UserIdentityResponseExample' + /api/v2/users/{user_id}/merge: + parameters: + - $ref: '#/components/parameters/UserId' + put: + operationId: MergeEndUsers + tags: + - Users + summary: Merge End Users + description: | + Merges the end user specified in the path parameter into the existing end user specified in the request body. + + Any two end users can be merged with the exception of end users created by sharing agreements. + + To be eligible for merging, the user in the path parameter must be a requester on 10,000 or fewer tickets. Otherwise, the merge will be blocked. + + Agents, admins, and users with more than 10,000 requested tickets cannot be merged. + + For more information about how user data is merged, see [Merging a user's duplicate account](https://support.zendesk.com/hc/en-us/articles/4408887695898) in Zendesk help. + + #### Allowed For + + * Admins or agents with permission to edit end users + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRequest' + examples: + default: + $ref: '#/components/examples/MergeEndUsersRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UserResponseExample' + /api/v2/users/{user_id}/organization_memberships: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserOrganizationMemberships + tags: + - Organization Memberships + summary: List Organization Memberships by User + description: | + Returns a list of organization memberships for the account, user or organization in question. + + **Note**: When returning organization memberships for a user, organization memberships are sorted with the default organization first, and then by organization name. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + - Agents + - End users + parameters: + - $ref: '#/components/parameters/OrganizationMembershipsInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipsResponseExample' + post: + operationId: CreateUserOrganizationMembership + tags: + - Organization Memberships + - Users + summary: Create Organization Membership for User + description: | + Assigns a user to a given organization. Returns an error with status 422 if the user is already assigned to the organization. + + #### Allowed For + + * Admins + * Agents when creating a new organization membership for an end user + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipCreateResponseExample' + /api/v2/users/{user_id}/organization_memberships/{organization_membership_id}: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/OrganizationMembershipId' + get: + operationId: ShowOrganizationMembershipByUserId + tags: + - Organization Memberships + summary: Show Organization Membership by User + description: | + #### Allowed for + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipResponseExample' + delete: + operationId: DeleteUserOrganizationMembership + tags: + - Organization Memberships + - Users + summary: Delete Organization Membership for User + description: | + Immediately removes a user from an organization and schedules a job to unassign all working tickets currently assigned to the user and organization combination. The `organization_id` of the unassigned tickets is set to null. + + #### Allowed for + + * Admins + * Agents when deleting an organization membership for an end user + responses: + "204": + description: No Content response + /api/v2/users/{user_id}/organization_memberships/{organization_membership_id}/make_default: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/OrganizationMembershipId' + put: + operationId: SetOrganizationMembershipAsDefault + tags: + - Organization Memberships + summary: Set Membership as Default + description: | + Sets the default organization membership of a given user. + + #### Allowed for + + * Admins + * Agents when setting the default organization membership for an end user + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipsResponseExample' + /api/v2/users/{user_id}/organization_subscriptions: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserOrganizationSubscriptions + tags: + - Organization Subscriptions + - Users + summary: List User's Organization Subscriptions + description: |- + Returns a list of organization subscriptions for a specific user. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For: + + * Agents + * End users + + For end users, the response will only list the subscriptions created by the requesting end user. + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationSubscriptionsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationSubscriptionsResponseExample' + /api/v2/users/{user_id}/organizations: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserOrganizations + tags: + - Organizations + summary: List User Organizations + description: | + Returns a list of organizations associated with the specified user. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents, with certain restrictions + + If the agent has a custom agent role that restricts their access to only users in their own organization, a 403 Forbidden error is returned. See [Creating custom agent roles](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents#topic_cxn_hig_bd) in Zendesk help. + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CursorPaginationSort' + - $ref: '#/components/parameters/IncludeBoundaryIndicators' + - $ref: '#/components/parameters/IncludeItemCursors' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + examples: + default: + $ref: '#/components/examples/OrganizationsResponseExample' + "403": + description: Forbidden - Agent has restricted access + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: Forbidden + "404": + description: User not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: RecordNotFound + /api/v2/users/{user_id}/organizations/{organization_id}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/UserId' + delete: + operationId: UnassignOrganization + tags: + - Organization Memberships + summary: Unassign Organization + description: | + Immediately removes a user from an organization and schedules a job to unassign all working tickets currently assigned to the user and organization combination. The `organization_id` of the unassigned tickets is set to null. + + #### Allowed For + + * Agents + responses: + "204": + description: No Content response + /api/v2/users/{user_id}/organizations/{organization_id}/make_default: + parameters: + - $ref: '#/components/parameters/UserId' + - $ref: '#/components/parameters/OrganizationId' + put: + operationId: SetOrganizationAsDefault + tags: + - Organization Memberships + summary: Set Organization as Default + description: | + Sets the default organization membership of a given user. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembershipResponse' + examples: + default: + $ref: '#/components/examples/OrganizationMembershipResponseExample' + /api/v2/users/{user_id}/organizations/count: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: CountUserOrganizations + tags: + - Organizations + - Users + summary: Count User's Organizations + description: | + Returns an approximate count of organizations for a specific user. If the count exceeds + 100,000, it is updated every 24 hours. + + The `refreshed_at` property of the `count` object is a timestamp that indicates + when the count was last updated. + + When the count exceeds 100,000, the `refreshed_at` property may + occasionally be null. This indicates that the count is being + updated in the background and the `value` property of the `count` object is limited to + 100,000 until the update is complete. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountOrganizationResponse' + examples: + default: + $ref: '#/components/examples/CountOrganizationsResponseExample' + /api/v2/users/{user_id}/password: + parameters: + - $ref: '#/components/parameters/UserId' + post: + operationId: SetUserPassword + tags: + - User Passwords + summary: Set a User's Password + description: | + An admin can set a user's password only if the setting is enabled in Zendesk Support under **Settings** > **Security** > **Global**. The setting is off by default. Only the account owner can access and change this setting. + + #### Allowed For + + * Admins + responses: + "200": + description: Success description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + put: + operationId: ChangeOwnPassword + tags: + - User Passwords + summary: Change Your Password + description: | + You can only change your own password. Nobody can change the password of another user because it requires knowing the user's existing password. However, an admin can set a new password for another user without knowing the existing password. See [Set a User's Password](#set-a-users-password) above. + + #### Allowed For + + * Agents + * End Users + responses: + "200": + description: Success description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/users/{user_id}/password/requirements: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: GetUserPasswordRequirements + tags: + - User Passwords + summary: List password requirements + description: | + #### Allowed For + + * Agents + * End Users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserPasswordRequirementsResponse' + examples: + default: + $ref: '#/components/examples/UserPasswordRequirementsResponseExample' + /api/v2/users/{user_id}/related: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ShowUserRelated + tags: + - Users + summary: Show User Related Information + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UserRelatedResponse' + examples: + default: + $ref: '#/components/examples/UserRelatedResponseExample' + /api/v2/users/{user_id}/requests: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserRequests + tags: + - Requests + summary: List User Requests + description: | + Lists requests for the specified user. + + #### Allowed for + + * End Users + parameters: + - name: sort_by + in: query + description: Possible values are "updated_at", "created_at" + schema: + type: string + - name: sort_order + in: query + description: One of "asc", "desc". Defaults to "asc" + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RequestsResponse' + examples: + default: + $ref: '#/components/examples/RequestsResponseExample' + /api/v2/users/{user_id}/sessions: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserSessions + tags: + - Sessions + - Users + summary: List Sessions for User + description: | + Lists all sessions for a specific user. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Allowed For + + * Admins, Agents, End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SessionsResponse' + examples: + default: + $ref: '#/components/examples/SessionsResponseExample' + delete: + operationId: BulkDeleteSessionsByUserId + tags: + - Sessions + summary: Bulk Delete Sessions + description: | + Deletes all the sessions for a user. + + #### Allowed For + + * Admins, Agents, End users + responses: + "204": + description: No Content + /api/v2/users/{user_id}/sessions/{session_id}: + parameters: + - $ref: '#/components/parameters/SessionId' + - $ref: '#/components/parameters/UserId' + get: + operationId: ShowSession + tags: + - Sessions + summary: Show Session + description: | + #### Allowed For + + * Admins, Agents, End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SessionResponse' + examples: + default: + $ref: '#/components/examples/SessionResponseExample' + delete: + operationId: DeleteSession + tags: + - Sessions + summary: Delete Session + description: | + #### Allowed For + + * Admins, Agents, End users + responses: + "204": + description: No Content + /api/v2/users/{user_id}/skips: + parameters: + - $ref: '#/components/parameters/SkipTicketUserId' + - $ref: '#/components/parameters/TicketSortOrder' + get: + operationId: ListTicketSkips + tags: + - Ticket Skips + summary: List Ticket Skips + description: | + Archived tickets are not included in the response. See + [About archived tickets](https://support.zendesk.com/hc/en-us/articles/203657756) in + the Support Help Center. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + * Agents with "View only" or higher reports permissions in Support. + These permissions are distinct from Explore permissions. + * Agents retrieving their own skips + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketSkipsResponse' + examples: + default: + $ref: '#/components/examples/TicketSkipResponseExample' + /api/v2/users/{user_id}/tags: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserTags + tags: + - Tags + summary: List User Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + post: + operationId: SetUserTags + tags: + - Tags + summary: Set User Tags + description: | + #### Allowed For + + * Agents + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + put: + operationId: PutUserTags + tags: + - Tags + summary: Add User Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsByObjectIdResponse' + delete: + operationId: DeleteUserTags + tags: + - Tags + summary: Remove User Tags + description: | + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TagsByObjectIdResponse' + examples: + default: + $ref: '#/components/examples/TagsRemoveResponseExample' + /api/v2/users/{user_id}/tickets/assigned: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserAssignedTickets + tags: + - Tickets + summary: List User Assigned Tickets + description: Lists tickets assigned to the specified user. + responses: + "200": + description: List tickets assigned to the user + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/users/{user_id}/tickets/assigned/count: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: CountUserAssignedTickets + tags: + - Tickets + summary: Count User Assigned Tickets + description: |- + Returns an approximate count of tickets assigned to the specified user. If the count exceeds 100,000, it is updated every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of tickets + content: + application/json: + schema: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + examples: + default: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + /api/v2/users/{user_id}/tickets/ccd: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserCCDTickets + tags: + - Tickets + summary: List User CCD Tickets + description: Lists tickets where the specified user is CC'd. + responses: + "200": + description: List tickets where the user is CC'd + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/users/{user_id}/tickets/ccd/count: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: CountUserCCDTickets + tags: + - Tickets + summary: Count User CCD Tickets + description: |- + Returns an approximate count of tickets where the specified user is CC'd. If the count exceeds 100,000, it is updated every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of tickets + content: + application/json: + schema: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + examples: + default: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + /api/v2/users/{user_id}/tickets/followed: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserFollowedTickets + tags: + - Tickets + summary: List User Followed Tickets + description: Lists tickets the specified user is following. + parameters: + - $ref: '#/components/parameters/TicketSortBy' + - $ref: '#/components/parameters/TicketSortOrder' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - name: exclude_archived + in: query + description: | + If true, excludes archived tickets from the results. + schema: + type: boolean + responses: + "200": + description: List tickets followed by the user + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/users/{user_id}/tickets/requested: + parameters: + - $ref: '#/components/parameters/UserId' + get: + operationId: ListUserRequestedTickets + tags: + - Tickets + summary: List User Requested Tickets + parameters: + - $ref: '#/components/parameters/TicketSortBy' + - $ref: '#/components/parameters/TicketSortOrder' + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/TicketsInclude' + - name: exclude_archived + in: query + description: | + If true, excludes archived tickets from the results. + schema: + type: boolean + - name: exclude_count + in: query + description: | + If true, excludes the total count from the results. + schema: + type: boolean + responses: + "200": + description: List tickets requested by the user + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/TicketsResponseExample' + /api/v2/users/autocomplete: + get: + operationId: AutocompleteUsers + tags: + - Users + summary: Autocomplete Users + description: | + Returns an array of users whose name starts with the value specified in the `name` parameter. + It only returns users with no foreign identities. + + #### Allowed For + + * Agents + parameters: + - name: name + in: query + description: | + The name to search for the user. You must specify either `name` or `phone`. + schema: + type: string + example: gil + - name: phone + in: query + description: | + The phone number to search for the user. You must specify either `name` or `phone`. + schema: + type: string + - name: filter + in: query + description: | + Filter to apply to autocomplete results. Accepted values: `assignable`, `requester`. + schema: + type: string + enum: + - assignable + - requester + - $ref: '#/components/parameters/LookupRelationshipAutocompleteFieldIdFragment' + - $ref: '#/components/parameters/LookupRelationshipAutocompleteSourceFragment' + - $ref: '#/components/parameters/UsersInclude' + - name: per_page + in: query + description: Number of results to return. + schema: + type: integer + minimum: 1 + maximum: 100 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/SearchUsersResponseExample' + post: + operationId: AutocompleteUsersPost + tags: + - Users + summary: Autocomplete Users by Request Body + description: | + Returns an array of users whose name starts with the value specified in the `name` property in the request body. + It only returns users with no foreign identities. + + This endpoint accepts the same parameters as the [GET method](#autocomplete-users-by-query-string) but they are specified in the request body instead of the query string. + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/UsersInclude' + - name: filter + in: query + description: | + Filter to apply to autocomplete results. Common values: `assignable`, `requester`. + schema: + type: string + - name: per_page + in: query + description: Number of results to return. + schema: + type: integer + minimum: 1 + maximum: 100 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + field_id: + type: integer + description: Field ID for lookup relationship autocomplete + filter: + description: Filter to apply (assignable, requester, or dynamic_values) + oneOf: + - type: string + enum: + - assignable + - requester + - type: object + properties: + dynamic_values: + type: object + name: + type: string + description: The name to search for the user + example: gil + phone: + type: string + description: The phone number to search for the user + source: + type: string + description: Source for lookup relationship autocomplete + example: + name: gil + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/SearchUsersResponseExample' + "400": + description: Bad request - Invalid filter value or query error + content: + application/json: + schema: + type: object + properties: + description: + type: string + error: + type: string + example: + description: Invalid query syntax + error: Query Error + "500": + description: Internal server error + content: + application/json: + schema: + type: object + properties: + description: + type: string + error: + type: string + example: + description: Service temporarily unavailable + error: Unavailable + /api/v2/users/count: + get: + operationId: CountUsers + tags: + - Users + summary: Count Users + description: | + Returns an approximate count of users. If the count exceeds 100,000, it is updated every 24 hours. + + The response includes a `refreshed_at` property in a `count` object that contains a timestamp indicating when the count was last updated. + + **Note**: When the count exceeds 100,000, the `refreshed_at` property may occasionally be null. + This indicates that the count is being updated in the background. The `count` object's `value` property is limited to 100,000 until the update is complete. + + #### Allowed For + + * Admins, Agents and Light Agents + parameters: + - $ref: '#/components/parameters/UserRoleFilter' + - $ref: '#/components/parameters/UserRolesFilter' + - $ref: '#/components/parameters/UserPermissionSetFilter' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CountResponse' + examples: + default: + $ref: '#/components/examples/UserCountResponseExample' + /api/v2/users/create_many: + post: + operationId: CreateManyUsers + tags: + - Users + summary: Create Many Users + description: | + Accepts an array of up to 100 user objects. + + **Note**: To protect the data in your Zendesk account, bulk user imports are not enabled by default in Zendesk accounts. The account owner must contact [Zendesk Customer Support](https://support.zendesk.com/hc/en-us/articles/4408843597850) to enable the imports. A 403 Forbidden + error is returned if data imports are not enabled. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage end users or team members + + #### Specifying an organization + + You can assign a user to an existing organization by setting an + `organization_id` property in the user object. + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UsersRequest' + examples: + default: + $ref: '#/components/examples/UsersCreateManyRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/users/create_or_update: + post: + operationId: CreateOrUpdateUser + tags: + - Users + summary: Create Or Update User + description: | + Creates a user if the user does not already exist, or updates an existing user + identified by e-mail address or external ID. + + If you don't specify a role parameter, the new user is assigned the role of end user. + + If you need to create users without sending out a verification email, include a `"skip_verify_email": true` property in the body. + + #### External ID Case Sensitivity + + When providing an external id to identify an existing user to update, the search for the user record is not case sensitive. + + However, if an existing user is found, the system will update the user's external id to match the case of the external id used to find the user. + + #### Response Status Code + + - If the user already exists in Zendesk, a successful request returns a 200 OK status code. + - If the user does not exist in Zendesk and is created, the request returns a 201 Created status code. + - In both cases, the API responds with a JSON body containing the full user object, which includes the user's id and the fully-resolved URL to the user resource. + + Example response: + ```json + { + "user": { + "id": 8929981612030, + "url": "https://{subdomain}.zendesk.com/api/v2/users/8929981612030", + ... + } + } + ``` + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage end users or team members + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRequest' + examples: + default: + $ref: '#/components/examples/UserRequestExample' + responses: + "200": + description: Successful response, when user exits + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UserCreateResponseExample' + "201": + description: Created response, when user is new + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + examples: + default: + $ref: '#/components/examples/UserCreateResponseExample' + /api/v2/users/create_or_update_many: + post: + operationId: CreateOrUpdateManyUsers + tags: + - Users + summary: Create Or Update Many Users + description: | + Accepts an array of up to 100 user objects. For each user, the user is created if it does not + already exist, or the existing user is updated. + + **Note**: To protect the data in your Zendesk account, bulk user imports are not enabled by default in Zendesk accounts. The account owner must contact [Zendesk Customer Support](https://support.zendesk.com/hc/en-us/articles/4408843597850) to enable the imports. A 403 Forbidden + error is returned if data imports are not enabled. + + Each individual user object can identify an existing user by `email` or by `external_id`. + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + + #### Allowed For + + * Admins and [agents in custom roles with permission](https://support.zendesk.com/hc/en-us/articles/4408882153882#topic_cxn_hig_bd) to manage end users or team members + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UsersRequest' + examples: + default: + $ref: '#/components/examples/UsersRequestExample' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/users/destroy_many: + delete: + operationId: DestroyManyUsers + tags: + - Users + summary: Bulk Delete Users + description: | + Accepts a comma-separated list of up to 100 user ids. + + The request takes an `ids` or an `external_ids` query parameter. + + #### Allowed for + + * Admins + + #### Response + + This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information. + parameters: + - name: ids + in: query + description: Id of the users to delete. Comma separated + schema: + type: string + example: 1,2,3 + - name: external_ids + in: query + description: External Id of the users to delete. Comma separated + schema: + type: string + example: abc,def,ghi + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusBulkDeleteResponseExample' + /api/v2/users/logout_many: + post: + operationId: LogoutManyUsers + tags: + - Users + summary: Logout many users + description: | + Accepts a comma-separated list of up to 100 user ids. + + #### Allowed For: + + * Admins + parameters: + - name: ids + in: query + description: | + Accepts a comma-separated list of up to 100 user ids. + schema: + type: string + example: 1,2 + responses: + "202": + description: Accepted response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/users/me: + get: + operationId: ShowCurrentUser + tags: + - Users + summary: Show Self + description: | + The endpoint returns [user information](/api-reference/ticketing/users/users/) and an `authenticity_token`. + + #### Allowed For + + * Anonymous users + + #### Authenticity Token + + Zendesk API calls made by end users from a Zendesk help center must include `authenticity_token` in the `X-CSRF-Token` HTTP header. This helps prevent [cross-site request forgery (CSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery) attacks. + + For an example using an authenticity token, see the AJAX request in the [Upgrading from Templating API v1](https://developer.zendesk.com/documentation/help_center/help-center-templates/v1#jquery) documentation. + parameters: + - $ref: '#/components/parameters/UsersInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/CurrentUserResponse' + examples: + default: + $ref: '#/components/examples/CurrentUserResponseExample' + /api/v2/users/me/logout: + delete: + operationId: DeleteAuthenticatedSession + tags: + - Sessions + summary: Delete the Authenticated Session + description: | + Deletes the current session. In practice, this only works when using session auth for requests, such as client-side requests + made from a Zendesk app. When using OAuth or basic authentication, you don't have a current session so this endpoint has no effect. + + #### Allowed For + + * Admins, Agents, End users + responses: + "204": + description: No Content + /api/v2/users/me/oauth/clients: + get: + operationId: ListCurrentUserOAuthClients + tags: + - OAuth Clients + summary: List Current User's Clients + description: | + Returns the OAuth clients owned by the current user. + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Admins + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientsResponse' + examples: + default: + $ref: '#/components/examples/OAuthClientsResponseExample' + /api/v2/users/me/session: + get: + operationId: ShowCurrentlyAuthenticatedSession + tags: + - Sessions + summary: Show the Currently Authenticated Session + description: | + #### Allowed For + + * Admins, Agents, End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/SessionResponse' + examples: + default: + $ref: '#/components/examples/SessionResponseExample' + /api/v2/users/me/session/renew: + get: + operationId: RenewCurrentSession + tags: + - Sessions + summary: Renew the current session + description: | + #### Allowed For + + * Admins, Agents, End users + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/RenewSessionResponse' + examples: + default: + $ref: '#/components/examples/RenewSessionResponseExample' + /api/v2/users/me/settings: + get: + operationId: ShowCurrentUserSettings + tags: + - Users + summary: Show Current User Settings + description: | + Returns the settings for the currently authenticated user. This includes UI preferences for onboarding, tooltips, keyboard shortcuts, theme preferences, and other feature toggles. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response - Returns current settings + content: + application/json: + schema: + $ref: '#/components/schemas/UserSettingsResponse' + examples: + default: + $ref: '#/components/examples/UserSettingsResponseExample' + put: + operationId: UpdateCurrentUserSettings + tags: + - Users + summary: Update Current User Settings + description: | + Updates the settings for the currently authenticated user. This includes UI preferences for onboarding, tooltips, keyboard shortcuts, theme preferences, and other feature toggles. + + Settings are grouped into: + - **Support**: Support UI preferences (onboarding, tooltips, shortcuts, theme) + - **admin_center**: Admin Center UI preferences (navigation, onboarding) + - **shared_views_order**: Optional array of view IDs for custom ordering + + Only the specified settings will be updated. Other settings will remain unchanged. + + #### Allowed For + + * Agents + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserSettingsUpdateRequest' + example: + settings: + admin_center: + has_admin_center_side_nav_open: true + lotus: + agent_workspace_theme_preference: "1" + keyboard_shortcuts_enabled: true + show_onboarding_tooltips: false + responses: + "200": + description: Success response - Returns updated settings + content: + application/json: + schema: + $ref: '#/components/schemas/UserSettingsResponse' + examples: + default: + $ref: '#/components/examples/UserSettingsResponseExample' + "400": + description: Bad request - No settings provided + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: BadRequest + "401": + description: Unauthorized - Not an agent + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: + error: Unauthorized + /api/v2/users/request_create: + post: + operationId: RequestUserCreate + tags: + - Users + summary: Request User Create + description: | + Sends the owner a reminder email to update their subscription so more agents can be created. + + #### Allowed For + + * Agents + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRequest' + examples: + default: + $ref: '#/components/examples/RequestUserCreateRequestExample' + responses: + "200": + description: description + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/users/search: + get: + operationId: SearchUsers + tags: + - Users + summary: Search Users + description: | + Returns an array of users who meet the search criteria. + + Returns up to 100 records per page to a maximum of 10,000 records per query. See [Using offset pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - name: query + in: query + description: | + The `query` parameter supports the Zendesk search syntax for more advanced + user searches. It can specify a partial or full value of any + user property, including name, email address, notes, or phone. Example: + `query="jdoe"`. + See the [Search API](/api-reference/ticketing/ticket-management/search/). + schema: + type: string + example: jdoe + - name: external_id + in: query + description: | + The `external_id` parameter does not support the search syntax. It only accepts ids. + schema: + type: string + example: abc124 + - $ref: '#/components/parameters/IncludeSideloads' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/SearchUsersResponseExample' + /api/v2/users/show_many: + get: + operationId: ShowManyUsers + tags: + - Users + summary: Show Many Users + description: | + Accepts a comma-separated list of up to 100 user ids or external ids. + + #### Allowed For: + + * Agents + parameters: + - name: ids + in: query + description: | + Accepts a comma-separated list of up to 100 user ids. + schema: + type: string + example: 1,2 + - name: external_ids + in: query + description: | + Accepts a comma-separated list of up to 100 external ids. + schema: + type: string + example: abc,def + - name: include_deleted + in: query + description: | + If true, returns inactive or deleted users. + schema: + type: boolean + - $ref: '#/components/parameters/UsersInclude' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + examples: + default: + $ref: '#/components/examples/ShowManyUsersResponseExample' + /api/v2/users/update_many: + put: + operationId: UpdateManyUsers + tags: + - Users + summary: Update Many Users + parameters: + - name: ids + in: query + description: Id of the users to update. Comma separated + schema: + type: string + example: 1,2,3 + - name: external_ids + in: query + description: External Id of the users to update. Comma separated + schema: + type: string + example: abc,def,ghi + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/UserUpdateRequest' + - $ref: '#/components/schemas/UsersRequest' + additionalProperties: true + examples: + default: + $ref: '#/components/examples/UpdateManyUsersRequestExample' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusResponse' + examples: + default: + $ref: '#/components/examples/JobStatusResponseExample' + /api/v2/views: + get: + operationId: ListViews + tags: + - Views + summary: List Views + description: | + Lists shared and personal views available to the current user. + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each view, if present + | permissions | The permissions for each view + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - name: access + in: query + description: Only views with given access. May be "personal", "shared", or "account" + schema: + type: string + - name: active + in: query + description: Only active views if true, inactive views if false + schema: + type: boolean + - name: group_id + in: query + description: Only views belonging to given group + schema: + type: integer + - name: sort + in: query + description: The sort parameter used with cursor pagination. Defaults to "created_at". Prefix with '-' for descending order + schema: + type: string + - name: sort_by + in: query + description: The sort_by parameter used with offset pagination. Possible values are "alphabetical", "created_at", or "updated_at". Defaults to "position" + schema: + type: string + - name: sort_order + in: query + description: The sort_order parameter used with offset pagination. One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsResponseExample' + post: + operationId: CreateView + tags: + - Views + summary: Create View + description: | + #### Allowed For + + * Agents + + #### JSON Format + + The JSON format consists of one property, a `view` object that lists the values to set when the view is created. + + **Note**: The request must include at least one condition in the `all` array that checks one of the following fields: `status`, `type`, `group_id`, `assignee_id`, or `requester_id`. + + | Name | Description + | ----------- | ----------- + | title | Required. The title of the view + | all | Required. An array of one or more conditions. A ticket must meet all of them to be included in the view. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + | any | An array of one or more conditions. A ticket must meet any of them to be included in the view. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + | description | The description of the view + | active | Allowed values are true or false. Determines if the view is displayed or not + | output | An object that specifies the columns to display. Example: `"output": {"columns": ["status", "description", "priority"]}`. See [View columns](#view-columns) + | restriction | An object that describes who can access the view. To give all agents access to the view, omit this property + + The `restriction` object has the following properties. + + | Name | Comment + | ---- | ------- + | type | Allowed values are "Group" or "User" + | id | The numeric ID of a single group or user + | ids | The numeric IDs of a single or more groups. Recommended for "Group" `type` + + If `type` is "Group", the `ids` property is the preferred method of specifying the group id or ids. + + #### Example Request Body + + ```js + { + "view": { + "title": "Kelly's tickets", + "raw_title": "{{dc.tickets_assigned_to_kelly}}", + "description": "Tickets that are assigned to Kelly", + "active": true, + "restriction": { + "type": "User", + "id": "213977756" + }, + "all": [ + { + "field": "status", + "operator": "less_than", + "value": "solved" + }, + { + "field": "group_id", + "operator": "is", + "value": "24000932" + }, + { + "field": "custom_fields_360011872073", + "operator": "is", + "value": "Canada" + }, + ... + ], + "output": { + "columns": ["status", "requester", "assignee"], + "group_by": "assignee", + "group_order": "desc", + "sort_by": "status", + "sort_order": "desc" + } + } + } + ``` + + #### View columns + + The `output` request parameter lets you specify what columns to include in the view in the agent interface. Example: `"output": {"columns": ["status", "description", "priority"]}`. The following table lists possible columns for views in the agent UI and the corresponding values in the `columns` array. + + For custom fields, specify the id of the custom field in the `columns` array. + + You can specify a total of 10 columns to a view. + + | View column title in UI | Value | + |---------------------------- | -------------------- | + | Assigned | `assigned` | + | Assignee | `assignee` | + | Due Date | `due_date` | + | Group | `group` | + | ID | `nice_id` | + | Updated | `updated` | + | Assignee updated | `updated_assignee` | + | Requester updated | `updated_requester` | + | Updater | `updated_by_type` | + | Organization | `organization` | + | Priority | `priority` | + | Requested | `created` | + | Requester | `requester` | + | Requester language | `locale_id` | + | Satisfaction | `satisfaction_score` | + | Solved | `solved` | + | Status category | `status` | + | Subject | `description` | + | Submitter | `submitter` | + | Ticket form | `ticket_form` | + | Type | `type` | + | Brand | `brand` | + | Ticket status | `custom_status_id` | + + #### View sorting + + You can group and sort items in the view by adding items to the `output` parameter: + + | Attribute | Description + |-----------------------------| ----------- + | `group_by`, `sort_by` | Sort or group the tickets by a column in the [View columns](#view-columns) table. The `description`, `submitter` and `custom_status_id` columns are not supported + | `group_order`, `sort_order` | Either "asc" or "desc" + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewResponse' + examples: + default: + $ref: '#/components/examples/ViewCreateResponseExample' + /api/v2/views/{view_id}: + parameters: + - $ref: '#/components/parameters/ViewId' + get: + operationId: ShowView + tags: + - Views + summary: Show View + description: | + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/IncludeSideloads' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewResponse' + examples: + default: + $ref: '#/components/examples/ViewResponseExample' + put: + operationId: UpdateView + tags: + - Views + summary: Update View + description: | + #### Allowed For + + * Agents + + #### JSON Format + + The PUT request takes one property, a `view` object that lists the values to update. All properties are optional. + + **Note**: Updating a condition updates the containing array, clearing the other conditions. Include all your conditions when updating any condition. + + | Name | Description + | ----------- | ----------- + | title | The title of the view + | all | An array of one or more conditions. A ticket must meet all the conditions to be included in the view. The PUT request replaces all existing conditions. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + | any | An array of one or more conditions. A ticket must meet any of them to be included in the view. At least one `all` condition must be defined with the `any` conditions. The PUT request replaces all existing `any` conditions. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + | active | Allowed values are true or false. Determines if the view is displayed or not + | output | An object that specifies the columns to display. Example: `"output": {"columns": ["status", "description," "priority"]}`. See [View columns](#view-columns) + | restriction | An object that describes who can access the view. To give all agents access to the view, omit this property + + The `restriction` object has the following properties. + + | Name | Comment + | ---- | ------- + | type | Allowed values are "Group" or "User" + | id | The numeric ID of a single group or user + | ids | The numeric IDs of a single or more groups. Recommended for "Group" `type` + + If `type` is "Group", the `ids` property is the preferred method of specifying the group id or ids. + + You can also update how items are sorted and grouped. See [View sorting](#view-sorting) in Create View. + + #### Example Request Body + + ```js + { + "view": { + "title": "Code red tickets", + "restriction": { + "type": "Group", + "ids": [10052, 10057, 10062, 10002] + }, + "all": [ + { + "field": "priority", + "operator": "is", + "value": "urgent" + } + ], + "output": { + "columns": ["status", "requester", "assignee", "updated"] + } + } + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewResponse' + examples: + default: + $ref: '#/components/examples/ViewUpdateResponseExample' + delete: + operationId: DeleteView + tags: + - Views + summary: Delete View + description: | + #### Allowed For + * Agents + responses: + "204": + description: No Content response + /api/v2/views/{view_id}/count: + parameters: + - $ref: '#/components/parameters/ViewId' + get: + operationId: GetViewCount + tags: + - Views + summary: Count Tickets in View + description: | + Returns the ticket count for a single view. + + This endpoint is rate limited to 5 requests per minute, per view, per agent. + + #### View Counts + + The view count endpoints, Count Tickets in View (this endpoint) and [Count Tickets in Views](#count-tickets-in-views), let you estimate how many tickets remain in a view without having to retrieve the entire view. They're designed to help estimate view size. From a business perspective, accuracy becomes less relevant as view size increases. + + To ensure quality of service, these counts are cached more heavily as the number of tickets in a view grows. For a view with thousands of tickets, you can expect the count to be cached for 60-90 minutes. As a result, the count may not reflect the actual number of tickets in your view. + + View counts are represented as JSON objects with the following attributes: + + | Name | Type | Comment + | --------------- | ------------| ------- + | view_id | integer | The id of the view + | url | string | The API url of the count + | value | integer | The cached number of tickets in the view. Can also be null if the system is loading and caching new data. Not to be confused with 0 tickets + | pretty | string | A pretty-printed text approximation of the view count + | fresh | boolean | false if the cached data is stale and the system is still loading and caching new data + | active | boolean | Only active views if true, inactive views if false, all views if null. + + #### Example + ```js + { + "view_count": { + "view_id": 25, + "url": "https://company.zendesk.com/api/v2/views/25/count", + "value": 719, + "pretty": "~700", + "fresh": true + } + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewCountResponse' + examples: + default: + $ref: '#/components/examples/ViewCountResponseExample' + /api/v2/views/{view_id}/execute: + parameters: + - $ref: '#/components/parameters/ViewId' + get: + operationId: ExecuteView + tags: + - Views + summary: Execute View + description: | + Returns the column titles and the rows of the specified view. + + The `columns` array lists the view's column titles and includes only views parameters. + + The `rows` array lists the values of each column for each ticket and includes parameters from both views and tickets. Though not displayed in the view, a partial ticket object is included with each row object. + + **Note**: To get the full ticket objects for a specified view, use [List Tickets from a View](#list-tickets-from-a-view). + + This endpoint is rate limited to 5 requests per minute, per view, per agent. This rate limit includes activity in Zendesk Support. An API script is more likely to encounter rate limit errors if the authenticating agent or admin is concurrently active in Zendesk Support. + + The view execution system is designed for periodic rather than high-frequency API usage. In particular, views called very frequently may be cached by Zendesk. This means that the API client will still receive a result, but that result may have been computed at any time within the last 10 minutes. + + Zendesk recommends using the Incremental Ticket Export endpoint to get the latest changes. You can call it more often, and it returns all the tickets that changed since the last poll. For details and rate limits, see [Incremental Exports](/api-reference/ticketing/ticket-management/incremental_exports/). + + View output sorting can be controlled by passing the `sort_by` and `sort_order` parameters in the format described in the table in [Preview Views](#preview-views). + + #### Allowed For + + * Agents + + #### Pagination + + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - name: sort_by + in: query + description: The ticket field used for sorting. This will either be a title or a custom field id. + schema: + type: string + - name: sort_order + in: query + description: The direction the tickets are sorted. May be one of 'asc' or 'desc' + schema: + type: string + - $ref: '#/components/parameters/IncludeSideloads' + - $ref: '#/components/parameters/ExcludeSideloads' + - name: group_by + in: query + description: The ticket field used for grouping. This will either be a title or a custom field id. + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewResponse' + examples: + default: + $ref: '#/components/examples/ViewExecuteResponseExample' + /api/v2/views/{view_id}/export: + parameters: + - $ref: '#/components/parameters/ViewId' + get: + operationId: ExportView + tags: + - Views + summary: Export View + description: | + Returns the csv attachment of the specified view if possible. Enqueues a job to produce the csv if necessary. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewExportResponse' + examples: + default: + $ref: '#/components/examples/ViewExportResponseExample' + /api/v2/views/{view_id}/tickets: + parameters: + - $ref: '#/components/parameters/ViewId' + get: + operationId: ListTicketsFromView + tags: + - Views + summary: List Tickets From a View + description: | + #### Allowed For + + * Agents + + #### Pagination + * Cursor pagination (recommended) + * Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + parameters: + - name: sort_by + in: query + description: Sort or group the tickets by a column in the [View columns](#view-columns) table. The `subject` and `submitter` columns are not supported + schema: + type: string + - name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/TicketsResponse' + examples: + default: + $ref: '#/components/examples/ViewListTicketsResponseEXample' + /api/v2/views/active: + get: + operationId: ListActiveViews + tags: + - Views + summary: List Active Views + description: | + Lists active shared and personal views available to the current user. + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each view, if present + | permissions | The permissions for each view + + #### Pagination + + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + Returns a maximum of 100 records per page. + + #### Allowed For + + * Agents + parameters: + - name: access + in: query + description: Only views with given access. May be "personal", "shared", or "account" + schema: + type: string + - name: group_id + in: query + description: Only views belonging to given group + schema: + type: integer + - name: sort_by + in: query + description: Possible values are "alphabetical", "created_at", or "updated_at". Defaults to "position" + schema: + type: string + - name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsActiveResponseExample' + /api/v2/views/compact: + get: + operationId: ListCompactViews + tags: + - Views + summary: List Views - Compact + description: | + A compacted list of shared and personal views available to the current user. This endpoint never returns more than 32 records and does not respect the "per_page" option. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsResponseExample' + /api/v2/views/count: + get: + operationId: CountViews + tags: + - Views + summary: Count Views + description: |- + Returns an approximate count of shared and personal views available to the current user. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours. + + The `count[refreshed_at]` property is a timestamp that indicates when the count was last updated. + + **Note**: When the count exceeds 100,000, `count[refreshed_at]` may occasionally be null. + This indicates that the count is being updated in the background, and `count[value]` is limited to 100,000 until the update is complete. + + #### Allowed For + * Agents + responses: + "200": + description: Count of views + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsCountResponse' + examples: + default: + $ref: '#/components/examples/ViewsCountResponseExample' + /api/v2/views/count_many: + get: + operationId: GetViewCounts + tags: + - Views + summary: Count Tickets in Views + description: "Returns the ticket count of each view in a list of views. Accepts up to 20 view ids per request. For the ticket count of a single view, see [Count Tickets in View](#count-tickets-in-view).\n\nOnly returns values for personal and shared views accessible to the user performing the request.\n\n***Note:***\nDue to the asynchronous operation of computing the counts for the requested views, some of the views' counts could be null. This means that the system is still computing the count for that view.\nPeriodically issue another request until all of the views' counts in the response are integers greater than zero. \n\n#### Rate limiting\n\nThis endpoint is rate limited to 6 requests every 1 minute.\n\n#### Allowed For\n\n* Agents\n" + parameters: + - name: ids + in: query + description: List of view's ids separated by commas. + required: true + schema: + type: string + example: 1,2,3 + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewCountsResponse' + examples: + default: + $ref: '#/components/examples/ViewCountsResponseExample' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Errors' + examples: + default: + value: + errors: + - code: TooManyRequests + title: Too many requests to update + /api/v2/views/definitions: + get: + operationId: ListViewDefinitions + tags: + - Views + summary: List View Filter Definitions + description: | + Returns the definitions of the conditions and actions a view can perform. + The definitions include conditions, output columns, groupable fields, and + sortable fields. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + type: object + properties: + definitions: + type: object + properties: + conditions_all: + type: array + items: + type: object + additionalProperties: true + conditions_any: + type: array + items: + type: object + additionalProperties: true + groupables: + type: array + items: + type: object + additionalProperties: true + output: + type: array + items: + type: object + additionalProperties: true + sortables: + type: array + items: + type: object + additionalProperties: true + examples: + default: + value: + definitions: + conditions_all: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: New + value: new + - enabled: true + title: Open + value: open + conditions_any: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: New + value: new + groupables: + - group: ticket + title: Status + type: list + value: status + output: + - group: ticket + title: ID + type: tagger + value: nice_id + sortables: + - group: ticket + title: ID + type: number + value: nice_id + /api/v2/views/destroy_many: + delete: + operationId: BulkDeleteViews + tags: + - Views + summary: Bulk Delete Views + description: | + Deletes the views corresponding to the provided list of IDs. + + #### Allowed For + * Agents + parameters: + - name: ids + in: query + description: The IDs of the views to delete + required: true + schema: + type: string + example: 1,2,3 + responses: + "204": + description: No Content response + /api/v2/views/preview: + post: + operationId: PreviewViews + tags: + - Views + summary: Preview Views + description: | + You can preview views by constructing the conditions in the proper format and nesting them under the `view` property. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference/). The output can also be controlled by passing in any of the following parameters and nesting them under the `output` property. + + | Name | Type | Comment + | --------------- | ------- | ------- + | columns | Array | The ticket fields to display. System fields are looked up by name, custom fields by title or id. See the [View columns](#view-columns) table + | group_by | String | When present, the field by which the tickets are grouped + | group_order | String | The direction the tickets are grouped. May be one of "asc" or "desc" + | sort_order | String | The direction the tickets are sorted. May be one of "asc" or "desc" + | sort_by | String | The ticket field used for sorting. This will either be a title or a custom field id. + + This endpoint is rate limited to 5 requests per minute, per view, per agent. + + #### Pagination + + - Cursor pagination (recommended) + - Offset pagination + + See [Pagination](/api-reference/introduction/pagination/). + + #### Allowed For + + * Agents + parameters: + - $ref: '#/components/parameters/DualPaginationPage' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/IncludeSideloads' + - $ref: '#/components/parameters/ExcludeSideloads' + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewResponse' + examples: + default: + $ref: '#/components/examples/ViewPreviewResponseExample' + /api/v2/views/preview/count: + post: + operationId: PreviewCount + tags: + - Views + summary: Preview Ticket Count + description: | + Returns the ticket count for a single preview. + + #### Allowed For + + * Agents + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewCountResponse' + examples: + default: + $ref: '#/components/examples/ViewCountResponseExample' + /api/v2/views/search: + get: + operationId: SearchViews + tags: + - Views + summary: Search Views + description: | + #### Pagination + + * Offset pagination only + + See [Using Offset Pagination](/api-reference/introduction/pagination/#using-offset-pagination). + + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported. For more information, see [Side-loading](/documentation/ticketing/using-the-zendesk-api/side_loading/). + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each view, if present + | permissions | The permissions for each view + parameters: + - name: query + in: query + description: Query string used to find all views with matching title + required: true + schema: + type: string + example: sales&group_id=25789188 + - name: access + in: query + description: Filter views by access. May be "personal", "shared", or "account" + schema: + type: string + - name: active + in: query + description: Filter by active views if true or inactive views if false + schema: + type: boolean + - name: group_id + in: query + description: Filter views by group + schema: + type: integer + - name: sort_by + in: query + description: Possible values are "alphabetical", "created_at", "updated_at", and "position". If unspecified, the views are sorted by relevance + schema: + type: string + - name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + - name: include + in: query + description: A sideload to include in the response. See [Sideloads](#sideloads-3) + schema: + type: string + example: permissions + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsResponseExample' + /api/v2/views/show_many: + get: + operationId: ListViewsById + tags: + - Views + summary: List Views By ID + description: | + #### Allowed For + + * Agents + + #### Sideloads + + The following sideloads are supported: + + | Name | Will sideload + | ---------------- | ------------- + | app_installation | The app installation that requires each view, if present + | permissions | The permissions for each view + parameters: + - name: ids + in: query + description: List of view's ids separated by commas. + required: true + schema: + type: string + example: 1,2,3 + - name: active + in: query + description: Only active views if true, inactive views if false + schema: + type: boolean + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsResponseExample' + /api/v2/views/update_many: + put: + operationId: UpdateManyViews + tags: + - Views + summary: Update Many Views + description: | + #### Allowed For + + * Agents + + #### Request Parameters + + The PUT request expects a `views` object that lists the views to update. + + Each view may have the following properties: + + | Name | Mandatory | Description + | -------- | --------- | ----------- + | id | yes | The ID of the view to update + | position | no | The new position of the view + | active | no | The active status of the view (true or false) + + #### Example Request Body + + ```js + { + "views": [ + {"id": 25, "position": 3}, + {"id": 23, "position": 5}, + {"id": 27, "position": 9}, + {"id": 22, "position": 7} + ] + } + ``` + responses: + "200": + description: Success response + content: + application/json: + schema: + $ref: '#/components/schemas/ViewsResponse' + examples: + default: + $ref: '#/components/examples/ViewsUpdateManyResponseExample' + /api/v2/workspaces: + get: + operationId: ListWorkspaces + tags: + - Workspaces + summary: List Workspaces + description: | + #### Allowed For + + * Admins, Agents + responses: + "200": + description: Success Response + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceResponse' + examples: + default: + value: + count: 1 + next_page: null + previous_page: null + workspaces: + - activated: true + apps: + - expand: false + id: 360000080413 + position: 1 + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + created_at: "2018-11-13T19:08:13Z" + description: Test rules + id: 3133 + macro_ids: + - 360005374974 + position: 1 + prefer_workspace_app_order: true + selected_macros: + - actions: + - field: status + value: solved + active: true + created_at: "2018-02-08T23:45:30Z" + description: null + id: 360005374974 + position: 9999 + restriction: + id: 360002226093 + ids: + - 360002226093 + type: Group + title: Close and redirect to topics + updated_at: "2018-11-08T22:27:00Z" + url: https://{subdomain}.zendesk.com/api/v2/macros/360005374974 + usage_7d: 0 + ticket_form_id: 360000014173 + title: Test Workspace 1 + updated_at: "2018-12-17T22:37:40Z" + url: https://{subdomain}.zendesk.com/api/v2/workspaces + post: + operationId: CreateWorkspace + tags: + - Workspaces + summary: Create Workspace + description: | + #### Allowed For + + * Admins + requestBody: + content: + application/json: + schema: + type: object + properties: + workspace: + $ref: '#/components/schemas/WorkspaceInput' + examples: + default: + value: + workspace: + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + description: Test rules + macros: + - 360005374974 + ticket_form_id: 360000014173 + title: Test Workspace 1 + responses: + "201": + description: Created workspace + content: + application/json: + schema: + type: object + properties: + workspace: + $ref: '#/components/schemas/WorkspaceObject' + examples: + default: + value: + workspace: + activated: true + apps: [ ] + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + created_at: "2018-11-13T19:08:13Z" + description: Test rules + id: 3133 + macro_ids: + - 360005374974 + position: 1 + prefer_workspace_app_order: true + selected_macros: + - actions: + - field: status + value: solved + active: true + created_at: "2018-02-08T23:45:30Z" + description: null + id: 360005374974 + position: 9999 + restriction: + id: 360002226093 + ids: + - 360002226093 + type: Group + title: Close and redirect to topics + updated_at: "2018-11-08T22:27:00Z" + url: https://{subdomain}.zendesk.com/api/v2/macros/360005374974 + usage_7d: 0 + ticket_form_id: 360000014173 + title: Test Workspace 1 + updated_at: "2018-12-17T22:37:40Z" + url: https://{subdomain}.zendesk.com/api/v2/workspaces + /api/v2/workspaces/{workspace_id}: + parameters: + - $ref: '#/components/parameters/WorkspaceId' + get: + operationId: ShowWorkspace + tags: + - Workspaces + summary: Show Workspace + description: | + #### Allowed For + * Admins + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: object + properties: + workspace: + $ref: '#/components/schemas/WorkspaceObject' + examples: + default: + value: + workspace: + activated: true + apps: [ ] + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + created_at: "2018-11-13T19:08:13Z" + description: Test rules + id: 3133 + macro_ids: + - 360005374974 + position: 1 + prefer_workspace_app_order: true + selected_macros: + - actions: + - field: status + value: solved + active: true + created_at: "2018-02-08T23:45:30Z" + description: null + id: 360005374974 + position: 9999 + restriction: + id: 360002226093 + ids: + - 360002226093 + type: Group + title: Close and redirect to topics + updated_at: "2018-11-08T22:27:00Z" + url: https://{subdomain}.zendesk.com/api/v2/macros/360005374974 + usage_7d: 0 + ticket_form_id: 360000014173 + title: Test Workspace 1 + updated_at: "2018-12-17T22:37:40Z" + url: https://{subdomain}.zendesk.com/api/v2/workspaces + put: + operationId: UpdateWorkspace + tags: + - Workspaces + summary: Update Workspace + description: |- + #### Allowed For + * Admins + requestBody: + content: + application/json: + schema: + type: object + properties: + workspace: + $ref: '#/components/schemas/WorkspaceInput' + examples: + default: + value: + workspace: + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + description: Test rules + macros: + - 360005374974 + ticket_form_id: 360000014173 + title: Test Workspace 1 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + workspace: + $ref: '#/components/schemas/WorkspaceObject' + examples: + default: + value: + workspace: + activated: true + apps: [ ] + conditions: + all: + - field: ticket_form_id + operator: is + value: "360000014173" + any: [ ] + created_at: "2018-11-13T19:08:13Z" + description: Test rules + id: 3133 + macro_ids: + - 360005374974 + position: 1 + prefer_workspace_app_order: true + selected_macros: + - actions: + - field: status + value: solved + active: true + created_at: "2018-02-08T23:45:30Z" + description: null + id: 360005374974 + position: 9999 + restriction: + id: 360002226093 + ids: + - 360002226093 + type: Group + title: Close and redirect to topics + updated_at: "2018-11-08T22:27:00Z" + url: https://{subdomain}.zendesk.com/api/v2/macros/360005374974 + usage_7d: 0 + ticket_form_id: 360000014173 + title: Test Workspace 1 + updated_at: "2018-12-17T22:37:40Z" + url: https://{subdomain}.zendesk.com/api/v2/workspaces + delete: + operationId: DeleteWorkspace + tags: + - Workspaces + summary: Delete Workspace + description: | + #### Allowed For + * Admins + responses: + "204": + description: No Content + /api/v2/workspaces/destroy_many: + delete: + operationId: DestroyManyWorkspaces + tags: + - Workspaces + summary: Bulk Delete Workspaces + description: | + #### Allowed For + * Admins + parameters: + - name: ids + in: query + description: The ids of the workspaces to delete + required: true + schema: + type: array + items: + type: integer + example: + - 1 + - 2 + - 3 + responses: + "200": + description: Succesful response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /api/v2/workspaces/reorder: + put: + operationId: ReorderWorkspaces + tags: + - Workspaces + summary: Reorder Workspaces + description: | + #### Allowed For + * Admins + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: number + examples: + default: + value: + ids: + - 12 + - 32 + - 48 + - 60 + responses: + "200": + description: Succesful response + content: + application/json: + schema: + type: string + description: Empty response + example: "" + example: "" + /oauth/tokens: + post: + operationId: CreateTokenForGrantType + tags: + - Grant Type Tokens + summary: Create Token for Grant Type + description: | + Returns an OAuth access token in exchange for one of the following: + + - an [authorization code](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_pvr_ncl_1l) + - a [refresh token](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_p1c_xjf_52c) + - a [client secret](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_s21_lfs_qk) + + **Note**: The password grant type flow, which used a Zendesk username and password to get an access token, has been deprecated and is highly discouraged. + + To revoke an access token, see [Revoke Token](/api-reference/ticketing/oauth/oauth_tokens/#revoke-token). + + #### Request parameters + + The POST request takes the following parameters, which must be formatted as JSON: + + | Name | Description + | ------------- | -------------------------------------------------- + | grant_type | "authorization_code", "refresh_token", or "client_credentials" + | code | Authorization grant flow only. The authorization code you received from Zendesk after the user granted access. The code is valid for only 120 seconds. See [Handle the user's authorization decision](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_ykc_dcm_dcc) in Zendesk help + | client_id | The **Identifier** value specified in an OAuth client in the Zendesk Admin Center (**Apps and integrations** > **APIs** > **OAuth clients**). See [Registering your application with Zendesk](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_s21_lfs_qk) + | client_secret | The **Secret** value specified in an OAuth client in the Admin Center (**Apps and integrations** > **APIs** > **OAuth clients**). See [Registering your application with Zendesk](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_s21_lfs_qk) + | redirect_uri | Authorization grant flow only. The redirect URL you specified when you sent the user to the Zendesk authorization page. For ID purposes only. See [Send the user to the Zendesk authorization page](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_mkc_dcm_dcc) + | scope | Valid scope for this token. A string of space-separated values. See [Scope](#scope) below + | expires_in | Number of seconds the access token is valid. Must be more than 300 seconds (5 minutes) and less than 172,800 seconds (2 days), or less than `refresh_token_expires_in`, whichever is the shorter. Defaults to null + | refresh_token_expires_in | Number of seconds the refresh token is valid. Must be more than 604,800 seconds (7 days) or `expires_in` (if given), and less than 7,776,000 seconds (90 days). Defaults to 2,592,000 seconds (30 days) + | refresh_token | A valid refresh token. See [Replacing expired access tokens](https://support.zendesk.com/hc/en-us/articles/4408845965210#topic_p1c_xjf_52c) + + **Authorization code example** + + ```javascript + const tokenResponse = await axios.post( + "https://{subdomain}.zendesk.com/oauth/tokens", + { + grant_type: "authorization_code", + code: AUTHORIZATION_CODE, + client_id: ZENDESK_CLIENT_ID, + redirect_uri: REDIRECT_URI_PKCE, + scope: "read write", + code_verifier: CODE_VERIFIER, + expires_in: 86400, + refresh_token_expires_in: 604800, + }, + { headers: { "Content-Type": "application/json" } } + ); + ``` + + **Refresh token example** + + ```javascript + const tokenResponse = await axios.post( + "https://{subdomain}.zendesk.com/oauth/tokens", + { + grant_type: "refresh_token", + refresh_token: REFRESH_TOKEN, + client_id: ZENDESK_CLIENT_ID, + client_secret: ZENDESK_CLIENT_SECRET, + scope: "tickets:write", + expires_in: 86400, + refresh_token_expires_in: 604800, + }, + { headers: { "Content-Type": "application/json" } } + ); + ``` + + **Client credentials example** + + ```javascript + const tokenResponse = await axios.post( + "https://{subdomain}.zendesk.com/oauth/tokens", + { + grant_type: "client_credentials", + client_id: ZENDESK_CLIENT_ID, + client_secret: ZENDESK_CLIENT_SECRET, + scope: "tickets:write", + expires_in: 86400 + }, + { headers: { "Content-Type": "application/json" } } + ); + ``` + + #### Scope + + You must specify a scope to control the app's access to Zendesk resources. The "read" scope gives access to GET endpoints. It includes permission to sideload related resources. The "write" scope gives access to POST, PUT, and DELETE endpoints for creating, updating, and deleting resources. + + **Note**: Don't confuse the **scope** parameter (singular) with the **scopes** parameter (plural) for non-grant-type tokens described in [OAuth Tokens](/api-reference/ticketing/oauth/oauth_tokens). + + The "impersonate" scope allows a Zendesk admin to make requests on behalf of end users. See [Making API requests on behalf of end users](/documentation/ticketing/using-the-zendesk-api/making-api-requests-on-behalf-of-end-users/). + + **Broad scopes** + + The following parameter gives read access to all resources: + + `"scope": "read"` + + The following parameter gives read and write access to all resources: + + `"scope": "read write"` + + **Resource-specific scopes** + + You can fine-tune the scope of the following resources: + + - [tickets](/api-reference/ticketing/tickets/tickets/) + - [users](/api-reference/ticketing/users/users/) + - [audit logs (read only)](/api-reference/ticketing/account-configuration/audit_logs/) + - [organizations](/api-reference/ticketing/organizations/organizations/) + - [help center resources](/api-reference/help_center/help-center-api/introduction/) + - [apps](/api-reference/apps/introduction/) + - [triggers](/api-reference/ticketing/business-rules/triggers/) + - [automations](/api-reference/ticketing/business-rules/automations/) + - [targets](/api-reference/ticketing/targets/targets/) + - [webhooks](/api-reference/webhooks/introduction/) + + The syntax is as follows: + + `"scope": "resource:scope"` + + For example, the following parameter restricts the scope to only reading tickets: + + `"scope": "tickets:read"` + + To give read and write access to a resource, specify both scopes: + + `"scope": "users:read users:write"` + + To give write access only to one resource, such as organizations, and read access to everything else: + + `"scope": "organizations:write read"` + + **Restrictions and limitations** + + A "Forbidden" error can occur either because the token is missing required scopes for an endpoint, or because the requested scopes were provided in an invalid format. + + - The resources defined in the scope must align with the resources accessed by the API endpoint. If the token lacks the required scope for an endpoint, the request will fail with a "Forbidden" error. + - The endpoint can return an access token even if you specify an invalid scope such as `"scope": ["read", "write"]`. Any request you make with the token will return a "Forbidden" error. + + #### Tokens for Implicit Grant Type + + The implicit grant flow has been deprecated. It's considered insecure and its use is highly discouraged. + responses: + "201": + description: Created response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokenForGrantTypesObject' + examples: + default: + $ref: '#/components/examples/OAuthTokenForGrantTypesResponseExample' +components: + schemas: + AccessRule: + type: object + properties: + conditions: + type: object + description: The conditions that define when this rule applies + properties: + all: + type: array + description: All conditions must be true (AND logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + any: + type: array + description: Any condition can be true (OR logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + created_at: + type: string + format: date-time + description: When the access rule was created + example: "2025-09-17T10:15:30Z" + description: + type: string + description: A description of what this access rule does + example: Access rule that limits access to orders created by the current user + id: + type: integer + description: The access rule ID + example: 6862342718335 + title: + type: string + description: The title of the access rule + example: Orders Created by Current User + updated_at: + type: string + format: date-time + description: When the access rule was last updated + example: "2025-09-17T14:30:45Z" + AccessRuleCondition: + type: object + properties: + field: + type: string + description: The field to evaluate in the condition + example: created_by_user + operator: + type: string + description: The comparison operator to use. Not all field types support all operators. + enum: + - is + - is_not + - greater_than + - less_than + - greater_than_equal + - less_than_equal + - includes + - not_includes + - matches + - present + example: matches + value: + description: The value to compare against. Can be null for terminal operators like 'present' and 'not_present' + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: "null" + example: current_user + AccessRuleCreateRequest: + type: object + properties: + access_rule: + type: object + properties: + conditions: + type: object + description: The conditions that define when this rule applies + properties: + all: + type: array + description: All conditions must be true (AND logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + any: + type: array + description: Any condition can be true (OR logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + description: + type: string + description: A description of what this access rule does + example: Access rule that limits access to orders created by the current user + title: + type: string + description: The title of the access rule + example: Orders Created by Current User + AccessRuleDefinitionsResponse: + type: object + properties: + definitions: + type: object + properties: + conditions_all: + type: array + description: Available field definitions for 'all' conditions (AND logic) + items: + $ref: '#/components/schemas/AccessRuleFieldDefinition' + conditions_any: + type: array + description: Available field definitions for 'any' conditions (OR logic) + items: + $ref: '#/components/schemas/AccessRuleFieldDefinition' + AccessRuleFieldDefinition: + type: object + properties: + group: + type: string + metadata: + type: object + properties: + collection_key: + type: string + field_id: + type: integer + nullable: true + item_key: + type: string + source: + type: string + nullable: true + url: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + format: + type: string + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + dynamic: + type: boolean + enabled: + type: boolean + title: + type: string + value: + type: string + AccessRuleResponse: + type: object + properties: + access_rule: + $ref: '#/components/schemas/AccessRule' + AccessRuleUpdateRequest: + type: object + properties: + access_rule: + type: object + properties: + conditions: + type: object + description: The conditions that define when this rule applies + properties: + all: + type: array + description: All conditions must be true (AND logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + any: + type: array + description: Any condition can be true (OR logic) + items: + $ref: '#/components/schemas/AccessRuleCondition' + description: + type: string + description: A description of what this access rule does + example: Access rule for orders above a certain value + title: + type: string + description: The title of the access rule + example: High Value Orders + AccessRulesResponse: + type: object + properties: + access_rules: + type: array + items: + $ref: '#/components/schemas/AccessRule' + AccountSettingsActiveFeaturesObject: + type: object + description: The active features for an account. See [Active Features](#active-features) + properties: + agent_forwarding: + type: boolean + allow_ccs: + type: boolean + allow_email_template_customization: + type: boolean + automatic_answers: + type: boolean + bcc_archiving: + type: boolean + benchmark_opt_out: + type: boolean + business_hours: + type: boolean + chat: + type: boolean + chat_about_my_ticket: + type: boolean + csat_reason_code: + type: boolean + custom_dkim_domain: + type: boolean + customer_context_as_default: + type: boolean + customer_satisfaction: + type: boolean + dynamic_contents: + type: boolean + explore: + type: boolean + explore_on_support_ent_plan: + type: boolean + explore_on_support_pro_plan: + type: boolean + facebook: + type: boolean + facebook_login: + type: boolean + fallback_composer: + type: boolean + forum_analytics: + type: boolean + good_data_and_explore: + type: boolean + google_login: + type: boolean + is_abusive: + type: boolean + light_agents: + type: boolean + markdown: + type: boolean + on_hold_status: + type: boolean + organization_access_enabled: + type: boolean + rich_content_in_emails: + type: boolean + sandbox: + type: boolean + satisfaction_prediction: + type: boolean + suspended_ticket_notification: + type: boolean + ticket_forms: + type: boolean + ticket_tagging: + type: boolean + topic_suggestion: + type: boolean + twitter: + type: boolean + twitter_login: + type: boolean + user_org_fields: + type: boolean + user_tagging: + type: boolean + voice: + type: boolean + AccountSettingsAgentObject: + type: object + description: Configuration for the agent workspace. See [Agents](#agents) + properties: + agent_home: + type: boolean + agent_workspace: + type: boolean + aw_self_serve_migration_enabled: + type: boolean + focus_mode: + type: boolean + idle_timeout_enabled: + type: boolean + unified_agent_statuses: + type: boolean + AccountSettingsApiObject: + type: object + description: API configuration options. See [API](#api) + properties: + accepted_api_agreement: + type: boolean + api_password_access_end_users: + type: boolean + api_token_access: + type: string + AccountSettingsAppsObject: + type: object + description: Apps configuration options. See [Apps](#apps) + properties: + create_private: + type: boolean + create_public: + type: boolean + use: + type: boolean + AccountSettingsBillingObject: + type: object + description: Billing configuration options. See [Billing](#billing) + properties: + backend: + type: string + AccountSettingsBrandingObject: + type: object + description: Branding settings. See [Branding](#branding) + properties: + favicon_url: + type: string + nullable: true + header_color: + type: string + header_logo_url: + type: string + nullable: true + page_background_color: + type: string + tab_background_color: + type: string + text_color: + type: string + AccountSettingsBrandsObject: + type: object + description: Brand settings. See [Brands](#brands) + properties: + default_brand_id: + type: integer + end_user_across_brand_requests: + type: boolean + require_brand_on_new_tickets: + type: boolean + AccountSettingsCdnObject: + type: object + description: CDN settings + properties: + cdn_provider: + type: string + fallback_cdn_provider: + type: string + hosts: + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + AccountSettingsChatObject: + type: object + description: Zendesk Chat settings. See [Chat](#chat) + properties: + available: + type: boolean + enabled: + type: boolean + integrated: + type: boolean + maximum_request_count: + type: integer + welcome_message: + type: string + AccountSettingsCrossSellObject: + type: object + description: Cross Sell settings + properties: + show_chat_tooltip: + type: boolean + xsell_source: + type: string + nullable: true + AccountSettingsDeviceObject: + type: object + description: End user device settings. See [Device Metadata](#device-metadata) + properties: + enabled: + type: boolean + hide_ip: + type: boolean + hide_location: + type: boolean + AccountSettingsEmailObject: + type: object + description: Email settings + properties: + accept_wildcard_emails: + type: boolean + custom_dkim_domain: + type: boolean + email_sender_authentication: + type: boolean + description: Whether incoming email is subjected to sender authentication checks (SPF, DKIM) + email_sender_authentication_profile: + type: string + description: The sender authentication profile in use. + enum: + - default + - enhanced + email_status: + type: boolean + description: Whether email status and delivery information is shown in the Agent Workspace + email_template_photos: + type: boolean + email_template_selection: + type: boolean + gmail_actions: + type: boolean + html_mail_template: + type: string + mail_delimiter: + type: string + modern_email_template: + type: boolean + no_mail_delimiter: + type: boolean + personalized_replies: + type: boolean + rich_content_in_emails: + type: boolean + send_gmail_messages_via_gmail: + type: boolean + text_mail_template: + type: string + AccountSettingsGoogleAppsObject: + type: object + description: Google Apps configuration. See [G Suite](#g-suite) + properties: + has_google_apps: + type: boolean + has_google_apps_admin: + type: boolean + AccountSettingsGroupObject: + type: object + description: Group configuration + properties: + check_group_name_uniqueness: + type: boolean + AccountSettingsKnowledgeObject: + type: object + description: Account's knowledge management and search capabilities. See [Knowledge](#knowledge) + properties: + default_search_filters_brands: + type: string + default_search_filters_categories: + type: string + default_search_filters_external_content_sources: + type: string + default_search_filters_locales: + type: string + default_search_filters_sections: + type: string + generative_answers: + type: boolean + require_article_templates: + type: boolean + search_articles: + type: boolean + search_community_posts: + type: boolean + search_external_content: + type: boolean + AccountSettingsLimitsObject: + type: object + description: Account limits configuration. See [Limits](#limits) + properties: + attachment_size: + type: integer + AccountSettingsLocalizationObject: + type: object + description: Internationalization configuration settings. See [Localization](#localization) + properties: + locale_ids: + type: array + items: + type: integer + AccountSettingsLotusObject: + type: object + description: Support UI settings. See [Lotus](#lotus) + properties: + pod_id: + type: integer + prefer_lotus: + type: boolean + reporting: + type: boolean + AccountSettingsMessageInactivityObject: + type: object + description: Auto-release capacity settings. See [Messaging inactivity](#messaging-inactivity) + properties: + default_localized_messages: + type: object + properties: + pre_solved_message_1: + type: string + description: The first pre-solved message + readOnly: true + pre_solved_message_2: + type: string + description: The second pre-solved message + readOnly: true + solved_message: + type: string + description: The solved message + readOnly: true + readOnly: true + enabled: + type: boolean + description: Whether the messaging inactivity feature is enabled + end_session: + type: boolean + description: Whether messaging session should end with the final reminder + reminders: + type: array + items: + type: object + properties: + message: + type: string + description: Mandatory message for the reminder + tags: + type: array + description: Array of strings, tags added to ticket with each reminder. Can be empty + items: + type: string + ticket_status_id: + type: integer + description: Ticket status id, available and mandatory for the 2nd and 3rd reminders, if the reminder is configured. The field can be null to indicate no status change + nullable: true + timeout: + type: integer + description: Reminder timeout in seconds, available and mandatory for the 2nd and 3rd reminders, if the reminder is configured + nullable: true + required: + - message + ticket_status_id: + type: integer + description: Ticket status id to apply on the ticket when it is marked as inactive + timeout: + type: integer + description: Timeout in minutes after which the ticket will be marked as inactive + AccountSettingsMetricsObject: + type: object + description: Account metrics settings. See [Metrics](#metrics) + properties: + account_size: + type: string + AccountSettingsObject: + type: object + properties: + active_features: + $ref: '#/components/schemas/AccountSettingsActiveFeaturesObject' + agents: + $ref: '#/components/schemas/AccountSettingsAgentObject' + api: + $ref: '#/components/schemas/AccountSettingsApiObject' + apps: + $ref: '#/components/schemas/AccountSettingsAppsObject' + billing: + $ref: '#/components/schemas/AccountSettingsBillingObject' + branding: + $ref: '#/components/schemas/AccountSettingsBrandingObject' + brands: + $ref: '#/components/schemas/AccountSettingsBrandsObject' + cdn: + $ref: '#/components/schemas/AccountSettingsCdnObject' + chat: + $ref: '#/components/schemas/AccountSettingsChatObject' + cross_sell: + $ref: '#/components/schemas/AccountSettingsCrossSellObject' + device_metadata: + $ref: '#/components/schemas/AccountSettingsDeviceObject' + email: + $ref: '#/components/schemas/AccountSettingsEmailObject' + google_apps: + $ref: '#/components/schemas/AccountSettingsGoogleAppsObject' + groups: + $ref: '#/components/schemas/AccountSettingsGroupObject' + knowledge: + $ref: '#/components/schemas/AccountSettingsKnowledgeObject' + limits: + $ref: '#/components/schemas/AccountSettingsLimitsObject' + localization: + $ref: '#/components/schemas/AccountSettingsLocalizationObject' + lotus: + $ref: '#/components/schemas/AccountSettingsLotusObject' + messaging_inactivity: + $ref: '#/components/schemas/AccountSettingsMessageInactivityObject' + metrics: + $ref: '#/components/schemas/AccountSettingsMetricsObject' + onboarding: + $ref: '#/components/schemas/AccountSettingsOnboardingObject' + routing: + $ref: '#/components/schemas/AccountSettingsRoutingObject' + rule: + $ref: '#/components/schemas/AccountSettingsRuleObject' + side_conversations: + $ref: '#/components/schemas/AccountSettingsSideConversationsObject' + statistics: + $ref: '#/components/schemas/AccountSettingsStatisticsObject' + ticket_form: + $ref: '#/components/schemas/AccountSettingsTicketFormObject' + tickets: + $ref: '#/components/schemas/AccountSettingsTicketObject' + twitter: + $ref: '#/components/schemas/AccountSettingsTwitterObject' + user: + $ref: '#/components/schemas/AccountSettingsUserObject' + voice: + $ref: '#/components/schemas/AccountSettingsVoiceObject' + example: + active_features: + agent_forwarding: false + allow_ccs: true + allow_email_template_customization: true + automatic_answers: false + bcc_archiving: false + benchmark_opt_out: false + business_hours: false + chat: false + chat_about_my_ticket: false + csat_reason_code: false + custom_dkim_domain: true + customer_context_as_default: false + customer_satisfaction: false + dynamic_contents: false + explore: true + explore_on_support_ent_plan: false + explore_on_support_pro_plan: false + facebook: false + facebook_login: false + fallback_composer: false + forum_analytics: true + good_data_and_explore: false + google_login: false + is_abusive: false + light_agents: false + markdown: false + on_hold_status: false + organization_access_enabled: true + rich_content_in_emails: true + sandbox: false + satisfaction_prediction: false + suspended_ticket_notification: false + ticket_forms: true + ticket_tagging: true + topic_suggestion: false + twitter: true + twitter_login: false + user_org_fields: true + user_tagging: true + voice: true + agents: + agent_home: false + agent_workspace: false + aw_self_serve_migration_enabled: true + focus_mode: false + idle_timeout_enabled: false + unified_agent_statuses: false + api: + accepted_api_agreement: true + api_password_access_end_users: true + api_token_access: "true" + apps: + create_private: true + create_public: false + use: true + billing: + backend: zuora + branding: + favicon_url: null + header_color: 78A300 + header_logo_url: null + page_background_color: "333333" + tab_background_color: 7FA239 + text_color: FFFFFF + brands: + default_brand_id: 1873 + end_user_across_brand_requests: false + require_brand_on_new_tickets: false + cdn: + cdn_provider: default + fallback_cdn_provider: secondary + hosts: + - name: default + url: https://static.zdassets.com + - name: secondary + url: https://static-fallback.zdassets.com + chat: + available: true + enabled: false + integrated: true + maximum_request_count: 1 + welcome_message: Hi there. How can I help today? + cross_sell: + show_chat_tooltip: true + xsell_source: null + device_metadata: + enabled: true + hide_ip: true + hide_location: true + email: + accept_wildcard_emails: false + custom_dkim_domain: false + email_sender_authentication: true + email_sender_authentication_profile: enhanced + email_status: true + email_template_photos: true + email_template_selection: false + gmail_actions: true + html_mail_template: "\r\n\r\n\r\n \r\n \r\n\r\n\r\n
\r\n
{{delimiter}}
\r\n {{content}}\r\n

\r\n
\r\n {{footer}} {{footer_link}}\r\n

\r\n {{quoted_content}}\r\n\r\n\r\n" + mail_delimiter: '{{txt.email.delimiter}}' + modern_email_template: true + no_mail_delimiter: true + personalized_replies: true + rich_content_in_emails: true + send_gmail_messages_via_gmail: true + text_mail_template: "{{content}}\r\n\r\n{{footer}}\r\n\r\n{{quoted_content}}" + google_apps: + has_google_apps: false + has_google_apps_admin: false + groups: + check_group_name_uniqueness: true + knowledge: + default_search_filters_brands: _TICKET + default_search_filters_categories: "" + default_search_filters_external_content_sources: "" + default_search_filters_locales: _TICKET + default_search_filters_sections: "" + generative_answers: true + require_article_templates: false + search_articles: true + search_community_posts: true + search_external_content: true + limits: + attachment_size: 52428800 + localization: + locale_ids: + - 1042 + lotus: + pod_id: 999 + prefer_lotus: true + reporting: true + messaging_inactivity: + default_localized_messages: + pre_solved_message_1: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + pre_solved_message_2: This ticket will be marked as solved soon. We hope to hear from you. + solved_message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + enabled: true + reminders: + - message: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + - message: This ticket will be marked as solved soon. We hope to hear from you. + ticket_status_id: null + timeout: 300 + - message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + ticket_status_id: 8678123367037 + timeout: 60 + ticket_status_id: 8001424138749 + timeout: 5 + metrics: + account_size: 100-399 + onboarding: + checklist_onboarding_version: 2 + onboarding_segments: null + product_sign_up: null + routing: + autorouting_tag: "" + enabled: false + max_email_capacity: 0 + max_messaging_capacity: 0 + reassignment_messaging_enabled: true + reassignment_messaging_timeout: 30 + reassignment_talk_timeout: 30 + rule: + macro_most_used: true + macro_order: alphabetical + skill_based_filtered_views: [ ] + using_skill_based_routing: false + side_conversations: + email_channel: false + msteams_channel: false + show_in_context_panel: false + slack_channel: false + tickets_channel: false + statistics: + forum: true + rule_usage: true + search: true + ticket_form: + raw_ticket_forms_instructions: Please choose your issue below + ticket_forms_instructions: Please choose your issue below + tickets: + accepted_new_collaboration_tos: false + agent_collision: true + agent_invitation_enabled: true + agent_ticket_deletion: false + allow_group_reset: true + assign_default_organization: true + assign_tickets_upon_solve: true + auto_translation_enabled: false + auto_updated_ccs_followers_rules: false + chat_sla_enablement: false + collaboration: true + comments_public_by_default: true + default_solved_ticket_reassignment_strategy: legacy + default_to_draft_mode: false + email_attachments: false + emoji_autocompletion: true + follower_and_email_cc_collaborations: false + has_color_text: true + is_first_comment_private_enabled: true + light_agent_email_ccs_allowed: false + list_empty_views: true + list_newest_comments_first: true + markdown_ticket_comments: false + maximum_personal_views_to_list: 8 + modern_ticket_reassignment: false + private_attachments: false + rich_text_comments: true + show_modern_ticket_reassignment: false + status_hold: false + tagging: true + using_skill_based_routing: false + twitter: + shorten_url: optional + user: + agent_created_welcome_emails: true + end_user_phone_number_validation: false + have_gravatars_enabled: true + language_selection: true + multiple_organizations: false + tagging: true + time_zone_selection: true + voice: + agent_confirmation_when_forwarding: true + agent_wrap_up_after_calls: true + enabled: true + logging: true + maximum_queue_size: 5 + maximum_queue_wait_time: 1 + only_during_business_hours: false + outbound_enabled: true + recordings_public: true + uk_mobile_forwarding: true + AccountSettingsOnboardingObject: + type: object + description: Onboarding settings + properties: + checklist_onboarding_version: + type: integer + onboarding_segments: + type: string + nullable: true + product_sign_up: + type: string + nullable: true + AccountSettingsResponse: + type: object + properties: + settings: + $ref: '#/components/schemas/AccountSettingsObject' + example: + settings: + active_features: + agent_forwarding: false + allow_ccs: true + allow_email_template_customization: true + automatic_answers: false + bcc_archiving: false + benchmark_opt_out: false + business_hours: false + chat: false + chat_about_my_ticket: false + csat_reason_code: false + custom_dkim_domain: true + customer_context_as_default: false + customer_satisfaction: false + dynamic_contents: false + explore: true + explore_on_support_ent_plan: false + explore_on_support_pro_plan: false + facebook: false + facebook_login: false + fallback_composer: false + forum_analytics: true + good_data_and_explore: false + google_login: false + is_abusive: false + light_agents: false + markdown: false + on_hold_status: false + organization_access_enabled: true + rich_content_in_emails: true + sandbox: false + satisfaction_prediction: false + suspended_ticket_notification: false + ticket_forms: true + ticket_tagging: true + topic_suggestion: false + twitter: true + twitter_login: false + user_org_fields: true + user_tagging: true + voice: true + agents: + agent_home: false + agent_workspace: false + aw_self_serve_migration_enabled: true + focus_mode: false + idle_timeout_enabled: false + unified_agent_statuses: false + api: + accepted_api_agreement: true + api_password_access_end_users: true + api_token_access: "true" + apps: + create_private: true + create_public: false + use: true + billing: + backend: zuora + branding: + favicon_url: null + header_color: 78A300 + header_logo_url: null + page_background_color: "333333" + tab_background_color: 7FA239 + text_color: FFFFFF + brands: + default_brand_id: 1873 + end_user_across_brand_requests: false + require_brand_on_new_tickets: false + cdn: + cdn_provider: default + fallback_cdn_provider: secondary + hosts: + - name: default + url: https://static.zdassets.com + - name: secondary + url: https://static-fallback.zdassets.com + chat: + available: true + enabled: false + integrated: true + maximum_request_count: 1 + welcome_message: Hi there. How can I help today? + cross_sell: + show_chat_tooltip: true + xsell_source: null + email: + accept_wildcard_emails: false + custom_dkim_domain: false + email_sender_authentication: true + email_sender_authentication_profile: enhanced + email_status: true + email_template_photos: true + email_template_selection: false + gmail_actions: true + html_mail_template: "\r\n\r\n\r\n \r\n \r\n\r\n\r\n
\r\n
{{delimiter}}
\r\n {{content}}\r\n

\r\n
\r\n {{footer}} {{footer_link}}\r\n

\r\n {{quoted_content}}\r\n\r\n\r\n" + mail_delimiter: '{{txt.email.delimiter}}' + modern_email_template: true + no_mail_delimiter: true + personalized_replies: true + rich_content_in_emails: true + send_gmail_messages_via_gmail: true + text_mail_template: "{{content}}\r\n\r\n{{footer}}\r\n\r\n{{quoted_content}}" + google_apps: + has_google_apps: false + has_google_apps_admin: false + groups: + check_group_name_uniqueness: true + limits: + attachment_size: 52428800 + localization: + locale_ids: + - 1042 + lotus: + pod_id: 999 + prefer_lotus: true + reporting: true + messaging_inactivity: + default_localized_messages: + pre_solved_message_1: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + pre_solved_message_2: This ticket will be marked as solved soon. We hope to hear from you. + solved_message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + enabled: true + reminders: + - message: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + - message: This ticket will be marked as solved soon. We hope to hear from you. + ticket_status_id: null + timeout: 300 + - message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + ticket_status_id: 8678123367037 + timeout: 60 + ticket_status_id: 8001424138749 + timeout: 5 + metrics: + account_size: 100-399 + onboarding: + checklist_onboarding_version: 2 + onboarding_segments: null + product_sign_up: null + routing: + autorouting_tag: "" + enabled: false + max_email_capacity: 0 + max_messaging_capacity: 0 + rule: + macro_most_used: true + macro_order: alphabetical + skill_based_filtered_views: [ ] + using_skill_based_routing: false + side_conversations: + email_channel: false + msteams_channel: false + show_in_context_panel: false + slack_channel: false + tickets_channel: false + statistics: + forum: true + rule_usage: true + search: true + ticket_form: + raw_ticket_forms_instructions: Please choose your issue below + ticket_forms_instructions: Please choose your issue below + tickets: + accepted_new_collaboration_tos: false + agent_collision: true + agent_invitation_enabled: true + agent_ticket_deletion: false + allow_group_reset: true + assign_default_organization: true + assign_tickets_upon_solve: true + auto_translation_enabled: false + auto_updated_ccs_followers_rules: false + chat_sla_enablement: false + collaboration: true + comments_public_by_default: true + default_solved_ticket_reassignment_strategy: legacy + default_to_draft_mode: false + email_attachments: false + emoji_autocompletion: true + follower_and_email_cc_collaborations: false + has_color_text: true + is_first_comment_private_enabled: true + light_agent_email_ccs_allowed: false + list_empty_views: true + list_newest_comments_first: true + markdown_ticket_comments: false + maximum_personal_views_to_list: 8 + modern_ticket_reassignment: false + private_attachments: false + rich_text_comments: true + show_modern_ticket_reassignment: false + status_hold: false + tagging: true + using_skill_based_routing: false + twitter: + shorten_url: optional + user: + agent_created_welcome_emails: true + end_user_phone_number_validation: false + have_gravatars_enabled: true + language_selection: true + multiple_organizations: false + tagging: true + time_zone_selection: true + voice: + agent_confirmation_when_forwarding: true + agent_wrap_up_after_calls: true + enabled: true + logging: true + maximum_queue_size: 5 + maximum_queue_wait_time: 1 + only_during_business_hours: false + outbound_enabled: true + recordings_public: true + uk_mobile_forwarding: true + AccountSettingsRoutingObject: + type: object + description: Configuration for routing. See [Routing](#routing) + properties: + autorouting_tag: + type: string + enabled: + type: boolean + max_email_capacity: + type: integer + max_messaging_capacity: + type: integer + reassignment_messaging_enabled: + type: boolean + reassignment_messaging_timeout: + type: integer + reassignment_talk_timeout: + type: integer + AccountSettingsRuleObject: + type: object + description: Rules settings for triggers, macros, views, and automations. See [Rules](#rules) + properties: + macro_most_used: + type: boolean + macro_order: + type: string + skill_based_filtered_views: + type: array + items: + type: object + additionalProperties: true + using_skill_based_routing: + type: boolean + AccountSettingsSideConversationsObject: + type: object + description: Side conversations settings + properties: + email_channel: + type: boolean + msteams_channel: + type: boolean + show_in_context_panel: + type: boolean + slack_channel: + type: boolean + tickets_channel: + type: boolean + AccountSettingsStatisticsObject: + type: object + description: Account statistics settings. See [Statistics](#statistics) + properties: + forum: + type: boolean + rule_usage: + type: boolean + search: + type: boolean + AccountSettingsTicketFormObject: + type: object + description: Ticket form settings. See [Ticket Form](#ticket-form) + properties: + raw_ticket_forms_instructions: + type: string + ticket_forms_instructions: + type: string + AccountSettingsTicketObject: + type: object + description: Ticket settings. See [Tickets](#tickets) + properties: + accepted_new_collaboration_tos: + type: boolean + agent_collision: + type: boolean + agent_invitation_enabled: + type: boolean + agent_ticket_deletion: + type: boolean + allow_group_reset: + type: boolean + assign_default_organization: + type: boolean + assign_tickets_upon_solve: + type: boolean + auto_translation_enabled: + type: boolean + auto_updated_ccs_followers_rules: + type: boolean + chat_sla_enablement: + type: boolean + collaboration: + type: boolean + comments_public_by_default: + type: boolean + default_solved_ticket_reassignment_strategy: + type: string + default_to_draft_mode: + type: boolean + email_attachments: + type: boolean + emoji_autocompletion: + type: boolean + follower_and_email_cc_collaborations: + type: boolean + has_color_text: + type: boolean + is_first_comment_private_enabled: + type: boolean + light_agent_email_ccs_allowed: + type: boolean + list_empty_views: + type: boolean + list_newest_comments_first: + type: boolean + markdown_ticket_comments: + type: boolean + maximum_personal_views_to_list: + type: integer + modern_ticket_reassignment: + type: boolean + private_attachments: + type: boolean + rich_text_comments: + type: boolean + show_modern_ticket_reassignment: + type: boolean + status_hold: + type: boolean + tagging: + type: boolean + using_skill_based_routing: + type: boolean + AccountSettingsTwitterObject: + type: object + description: X (formerly Twitter) settings. See [X](#x-formerly-twitter) + properties: + shorten_url: + type: string + AccountSettingsUserObject: + type: object + description: User settings. See [Users](#users) + properties: + agent_created_welcome_emails: + type: boolean + end_user_phone_number_validation: + type: boolean + have_gravatars_enabled: + type: boolean + language_selection: + type: boolean + multiple_organizations: + type: boolean + tagging: + type: boolean + time_zone_selection: + type: boolean + AccountSettingsVoiceObject: + type: object + description: Zendesk Talk settings. See [Voice](#voice) + properties: + agent_confirmation_when_forwarding: + type: boolean + agent_wrap_up_after_calls: + type: boolean + enabled: + type: boolean + logging: + type: boolean + maximum_queue_size: + type: integer + maximum_queue_wait_time: + type: integer + only_during_business_hours: + type: boolean + outbound_enabled: + type: boolean + recordings_public: + type: boolean + uk_mobile_forwarding: + type: boolean + ActionObject: + type: object + properties: + field: + type: string + description: The name of a ticket field to modify + value: + type: string + description: The new value of the field + ActionsObject: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/ActionObject' + ActivitiesCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + ActivitiesResponse: + type: object + properties: + activities: + type: array + items: + $ref: '#/components/schemas/ActivityObject' + readOnly: true + actors: + type: array + items: + type: object + additionalProperties: true + readOnly: true + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + users: + type: array + items: + type: object + additionalProperties: true + readOnly: true + example: + activities: + - actor: + active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + actor_id: 158488612 + created_at: "2020-11-17T00:34:40Z" + id: 29183462 + object: + ticket: + id: 1521 + subject: test + target: + ticket: + id: 1521 + subject: test + title: 'Tedd assigned ticket #1521 to you.' + updated_at: "2020-11-17T00:34:40Z" + url: https://example.zendesk.com/api/v2/activities/29183462 + user: + active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + user_id: 3343 + verb: tickets.assignment + actors: + - active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + count: 1 + next_page: null + previous_page: null + users: + - active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + ActivityObject: + title: Ticket Activities + type: object + properties: + actor: + type: object + description: The full user record of the user responsible for the ticket activity. See [Users](/api-reference/ticketing/users/users/) + allOf: + - $ref: '#/components/schemas/UserObject' + readOnly: true + actor_id: + type: integer + description: The id of the user responsible for the ticket activity. An `actor_id` of "-1" is a Zendesk system user, such as an automations action. + readOnly: true + created_at: + type: string + description: When the record was created + readOnly: true + id: + type: integer + description: Automatically assigned on creation + readOnly: true + object: + type: object + description: The content of the activity. Can be a ticket, comment, or change. + additionalProperties: true + readOnly: true + target: + type: object + description: The target of the activity, a ticket. + additionalProperties: true + readOnly: true + title: + type: string + description: Description of the activity + readOnly: true + updated_at: + type: string + description: When the record was last updated + readOnly: true + url: + type: string + description: The API url of the activity + readOnly: true + user: + type: object + description: The full user record of the agent making the request. See [Users](/api-reference/ticketing/users/users/) + allOf: + - $ref: '#/components/schemas/UserObject' + readOnly: true + user_id: + type: integer + description: The id of the agent making the request + readOnly: true + verb: + type: string + description: The type of activity. Can be "tickets.assignment", "tickets.comment", or "tickets.priority_increase" + readOnly: true + example: + actor: + id: 8678530 + name: James A. Rosen + actor_id: 23546 + created_at: "2019-03-05T10:38:52Z" + id: 35 + object: { } + target: { } + title: 'John Hopeful assigned ticket #123 to you' + updated_at: "2019-03-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/activities/35 + user: + id: 223443 + name: Johnny Agent + user_id: 29451 + verb: tickets.assignment + ActivityResponse: + type: object + properties: + activity: + $ref: '#/components/schemas/ActivityObject' + example: + activity: + actor: + active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + actor_id: 158488612 + created_at: "2020-11-17T00:34:40Z" + id: 29183462 + object: + ticket: + id: 1521 + subject: test + target: + ticket: + id: 1521 + subject: test + title: 'Tedd assigned ticket #1521 to you.' + updated_at: "2020-11-17T00:34:40Z" + url: https://example.zendesk.com/api/v2/activities/29183462 + user: + active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + user_id: 3343 + verb: tickets.assignment + ApprovalRequestCreateRequest: + title: ApprovalRequestCreateRequest + type: object + properties: + assignee_group_id: + type: integer + format: int64 + description: The id of the group assigned to review and approve the request + example: 789 + nullable: true + assignee_user_id: + type: integer + format: int64 + description: The id of the user assigned to review and approve the request + example: 456 + nullable: true + message: + type: string + description: Details and context for the approval request + example: Please approve this request for a new laptop for the engineering team + subject: + type: string + description: Subject line for the approval request + example: Laptop Purchase Approval + ticket_id: + type: integer + format: int64 + description: The id of the ticket the approval request was added to + example: 123 + required: + - message + - subject + - ticket_id + ApprovalRequestError: + type: object + properties: + code: + type: string + description: Error code identifying the type of error + example: ApprovalRequestCreationFailed + title: + type: string + description: Human-readable error message + example: Unable to create approval request + required: + - code + - title + ApprovalRequestErrors: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/ApprovalRequestError' + ApprovalRequestObject: + type: object + properties: + assignee_group_id: + type: integer + format: int64 + description: The id of the group assigned to review the request + nullable: true + assignee_user_id: + type: integer + format: int64 + description: The id of the user assigned to respond to the request. Also referred to as the `approver` + example: 456 + nullable: true + created_at: + type: string + format: date-time + description: The ISO 8601 formatted date-time when the approval request was created + example: "2026-01-23T19:02:36Z" + readOnly: true + created_by_id: + type: integer + format: int64 + description: The id of the user who created the approval request + example: 789 + readOnly: true + id: + type: string + description: Unique identifier for the approval request (ULID format) + example: 01KFP3S9EVXF9CKAYY080NV98C + readOnly: true + message: + type: string + description: Details and context for the approval request + example: Please approve this request for a new laptop + origination_type: + type: string + description: How the approval request was created + enum: + - API_ORIGINATION + - UI_ORIGINATION + - TRIGGER_ORIGINATION + - DATA_IMPORTER_ORIGINATION + - TEMPLATE_ORIGINATION + - ACTION_FLOW_ORIGINATION + - UNKNOWN_ORIGINATION + example: API_ORIGINATION + nullable: true + readOnly: true + status: + type: string + description: Current status of the approval request + example: active + readOnly: true + subject: + type: string + description: Subject line for the approval request + example: Laptop Purchase Approval + ticket_id: + type: integer + format: int64 + description: The id of the ticket this approval request is attached to + example: 123 + ApprovalRequestSimpleResponse: + title: ApprovalRequestSimpleResponse + type: object + properties: + approval_request: + type: object + properties: + assignee_group_id: + type: integer + format: int64 + description: The id of the group assigned to review the request + nullable: true + assignee_user_id: + type: integer + format: int64 + description: The id of the user assigned to review the request + example: 456 + nullable: true + created_at: + type: string + format: date-time + description: The time the approval request was created + example: "2026-01-23T19:02:36Z" + created_by_id: + type: integer + format: int64 + description: The id of the user who created the approval request + example: 789 + id: + type: string + description: Unique identifier for the approval request (ULID format) + example: 01KFP3S9EVXF9CKAYY080NV98C + message: + type: string + description: Details and context for the approval request + example: Please approve this request for a new laptop + origination_type: + type: string + description: How the approval request was created + enum: + - API_ORIGINATION + - UI_ORIGINATION + - TRIGGER_ORIGINATION + - DATA_IMPORTER_ORIGINATION + - TEMPLATE_ORIGINATION + - ACTION_FLOW_ORIGINATION + - UNKNOWN_ORIGINATION + example: API_ORIGINATION + nullable: true + status: + type: string + description: Current status of the approval request + example: active + subject: + type: string + description: Subject line for the approval request + example: Laptop Purchase Approval + ticket_id: + type: integer + format: int64 + description: The id of the ticket this approval request is attached to + example: 123 + ApprovalRequestsListResponse: + title: ApprovalRequestsListResponse + type: object + description: Response for listing approval requests with cursor pagination + properties: + approval_requests: + type: array + items: + type: object + properties: + assignee_group: + type: object + properties: + id: + type: integer + description: Unique identifier for the assigned group + name: + type: string + description: Name of the assigned group + nullable: true + assignee_user: + type: object + properties: + id: + type: integer + description: Unique identifier for the assigned user + name: + type: string + description: Name of the assigned user + nullable: true + created_at: + type: string + format: date-time + description: The time the approval request was created + readOnly: true + id: + type: string + description: Unique identifier for the approval request + message: + type: string + description: Details for the approval request + origination_type: + type: string + description: Source where the approval request originated from (example, "UI_ORIGINATION") + status: + type: string + description: Current status of the approval request (active, approved, rejected, withdrawn) + subject: + type: string + description: Subject for the approval request + ticket_id: + type: integer + description: The id of the ticket associated with this approval request + links: + type: object + description: Links for navigation + properties: + next: + type: string + description: Link to the next page of results + nullable: true + prev: + type: string + description: Link to the previous page of results + nullable: true + meta: + type: object + description: Metadata about the response + properties: + after_cursor: + type: string + description: Cursor for fetching the next page of results + nullable: true + before_cursor: + type: string + description: Cursor for fetching the previous page of results + nullable: true + has_more: + type: boolean + description: Indicates if there are more results available + AssigneeFieldAssignableAgentObject: + title: AssigneeFieldAssignableAgents + type: object + properties: + avatar_url: + type: string + description: URL of Agent's avatar + nullable: true + id: + type: integer + description: Agent Support ID + name: + type: string + description: Name of the agent + example: + avatar_url: https://z3n-example.zendesk.com/system/photos/900005192023/my_profile.png + id: 6473829100 + name: Joe Smith + AssigneeFieldAssignableGroupAgentsResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/AssigneeFieldAssignableAgentObject' + count: + type: integer + description: Number of agents listed in `agents` property. + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + example: + agents: + - avatar_url: https://z3n-example.zendesk.com/system/photos/900005192023/my_profile.png + id: 6473829100 + name: Joe Smith + - avatar_url: https://z3n-example.zendesk.com/system/photos/412005192023/my_profile.png + id: 9182736400 + name: Jane Doe + - avatar_url: https://z3n-example.zendesk.com/system/photos/887005192023/my_profile.png + id: 1928373460 + name: Cookie Monster + count: 3 + next_page: null + previous_page: null + AssigneeFieldAssignableGroupObject: + title: AssigneeFieldAssignableGroups + type: object + properties: + description: + type: string + description: Description of the group + readOnly: true + id: + type: integer + description: Group ID + readOnly: true + name: + type: string + description: Name of the group + readOnly: true + example: + description: Engineering team for bugs + id: 9182736455 + name: Engineering + AssigneeFieldAssignableGroupsAndAgentsSearchResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/AssigneeFieldAssignableSearchAgentObject' + count: + type: integer + description: Number of agents + groups listed from search result. + groups: + type: array + items: + $ref: '#/components/schemas/AssigneeFieldAssignableSearchGroupObject' + example: + agents: + - group: Tech + group_id: 6574839201 + id: 8392017465 + name: Sam Technologist + photo_url: https://z3n-example.zendesk.com/system/photos/410305192023/my_profile.png + count: 2 + groups: + - id: 6574839201 + name: Tech + AssigneeFieldAssignableGroupsResponse: + type: object + properties: + count: + type: integer + description: Number of groups listed in `groups` property. + groups: + type: array + items: + $ref: '#/components/schemas/AssigneeFieldAssignableGroupObject' + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + example: + count: 3 + groups: + - description: Engineering + id: 9182736455 + name: Group for Bugs for Engineering + - description: Product + id: 1928374655 + name: Group for feature requests + - description: Customer Support + id: 5519283746 + name: Group for customer inquiries + next_page: null + previous_page: null + AssigneeFieldAssignableSearchAgentObject: + type: object + properties: + group: + type: string + description: Name of the agent's group + group_id: + type: integer + description: Agent's Group ID + id: + type: integer + description: Agent ID + name: + type: string + description: Name of the agent + photo_url: + type: string + description: URL of Avatar + nullable: true + example: + group: Engineering + group_id: 9182736455 + id: 6473829100 + name: Joe Smith + photo_url: https://z3n-example.zendesk.com/system/photos/900005192023/my_profile.png + AssigneeFieldAssignableSearchGroupObject: + type: object + properties: + id: + type: integer + description: Group ID + name: + type: string + description: Name of the group + example: + id: 9182736455 + name: Engineering + AttachmentBaseObject: + type: object + properties: + content_type: + type: string + description: 'The content type of the image. Example value: "image/png"' + readOnly: true + content_url: + type: string + description: A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See [Working with url properties](/documentation/api-basics/best-practices/working-with-url-properties/) + readOnly: true + deleted: + type: boolean + description: If true, the attachment has been deleted + readOnly: true + file_name: + type: string + description: The name of the image file + readOnly: true + height: + type: integer + description: The height of the image file in pixels. If height is unknown, returns null + readOnly: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + inline: + type: boolean + description: | + If true, the attachment is excluded from the attachment list and the attachment's URL + can be referenced within the comment of a ticket. Default is false + readOnly: true + malware_access_override: + type: boolean + description: If true, you can download an attachment flagged as malware. If false, you can't download such an attachment. + readOnly: true + malware_scan_result: + type: string + description: 'The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: "malware_found", "malware_not_found", "failed_to_scan", "not_scanned"' + readOnly: true + mapped_content_url: + type: string + description: The URL the attachment image file has been mapped to + readOnly: true + size: + type: integer + description: The size of the image file in bytes + readOnly: true + url: + type: string + description: A URL to access the attachment details + readOnly: true + width: + type: integer + description: The width of the image file in pixels. If width is unknown, returns null + readOnly: true + AttachmentObject: + type: object + description: A file represented as an [Attachment](/api-reference/ticketing/tickets/ticket-attachments/) object + allOf: + - $ref: '#/components/schemas/AttachmentBaseObject' + - $ref: '#/components/schemas/AttachmentThumbnails' + example: + content_type: image/png + content_url: https://company.zendesk.com/attachments/my_funny_profile_pic.png + file_name: my_funny_profile_pic.png + id: 928374 + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/attachments/my_funny_profile_pic_thumb.png + file_name: my_funny_profile_pic_thumb.png + id: 928375 + size: 58298 + AttachmentResponse: + type: object + properties: + attachment: + $ref: '#/components/schemas/AttachmentObject' + AttachmentThumbnails: + type: object + properties: + thumbnails: + type: array + description: An array of attachment objects. Note that photo thumbnails do not have thumbnails + items: + $ref: '#/components/schemas/AttachmentBaseObject' + readOnly: true + AttachmentUpdateInput: + type: object + properties: + malware_access_override: + type: boolean + description: If true, allows access to attachments with detected malware. + AttachmentUpdateRequest: + type: object + properties: + attachment: + $ref: '#/components/schemas/AttachmentUpdateInput' + AttachmentUploadResponse: + type: object + properties: + upload: + type: object + properties: + attachment: + $ref: '#/components/schemas/AttachmentObject' + attachments: + type: array + items: + $ref: '#/components/schemas/AttachmentObject' + token: + type: string + description: Token for subsequent request + readOnly: true + AuditLogObject: + type: object + properties: + action: + type: string + description: | + Type of change made. Possible values are "create", "destroy", "exported", "login", and "update" + readOnly: true + action_label: + type: string + description: Localized string of action field + readOnly: true + actor_id: + type: integer + description: id of the user or system that initiated the change + readOnly: true + actor_name: + type: string + description: Name of the user or system that initiated the change + readOnly: true + change_description: + type: string + description: The description of the change that occurred + readOnly: true + created_at: + type: string + format: date-time + description: The time the audit got created + readOnly: true + id: + type: integer + description: The id automatically assigned upon creation + readOnly: true + ip_address: + type: string + description: The IP address of the user doing the audit + readOnly: true + source_id: + type: integer + description: The id of the item being audited + readOnly: true + source_label: + type: string + description: The name of the item being audited + readOnly: true + source_type: + type: string + description: | + Item type being audited. Typically describes the system where the change + was initiated. Possible values vary based on your account's Zendesk + products and activity. Common values include "apitoken", "rule", "ticket", + "user", and "zendesk/app_market/app". The "rule" value is used for + [automations](https://support.zendesk.com/hc/en-us/articles/4408832701850), + [macros](https://support.zendesk.com/hc/en-us/articles/4408844187034), + [triggers](https://support.zendesk.com/hc/en-us/articles/4408822236058), + [views](https://support.zendesk.com/hc/en-us/articles/4408888828570), + and other automated business rules + readOnly: true + url: + type: string + description: The URL to access the audit log + readOnly: true + example: + action: update + action_label: Updated + actor_id: 1234 + actor_name: Sameer Patel + change_description: Role changed from Administrator to End User + created_at: "2012-03-05T11:32:44Z" + id: 498483 + ip_address: 209.119.38.228 + source_id: 3456 + source_label: John Doe + source_type: user + url: https://company.zendesk.com/api/v2/audit_logs/498483 + AuditLogResponse: + type: object + properties: + audit_log: + $ref: '#/components/schemas/AuditLogObject' + AuditLogsResponse: + type: object + properties: + audit_logs: + type: array + items: + $ref: '#/components/schemas/AuditLogObject' + AuditObject: + type: object + properties: + author_id: + type: integer + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + events: + type: array + items: + type: object + properties: + body: + type: string + readOnly: true + field_name: + type: string + readOnly: true + id: + type: integer + readOnly: true + type: + type: string + readOnly: true + value: + oneOf: + - type: string + - type: integer + readOnly: true + id: + type: integer + readOnly: true + metadata: + type: object + readOnly: true + ticket_id: + type: integer + readOnly: true + via: + $ref: '#/components/schemas/ViaObject' + AuthorObject: + type: object + properties: + email: + type: string + description: The author email + readOnly: true + id: + type: integer + description: The author id + readOnly: true + name: + type: string + description: The author name + readOnly: true + AutomationObject: + type: object + properties: + actions: + type: array + description: An object describing what the automation will do. See [Actions reference](/documentation/ticketing/reference-guides/actions-reference) + items: + $ref: '#/components/schemas/ActionObject' + active: + type: boolean + description: Whether the automation is active + conditions: + $ref: '#/components/schemas/ConditionsObject' + created_at: + type: string + format: date-time + description: The time the automation was created + readOnly: true + default: + type: boolean + description: If true, the automation is a default automation + readOnly: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + position: + type: integer + description: The position of the automation which specifies the order it will be executed + raw_title: + type: string + description: The raw title of the automation + readOnly: true + title: + type: string + description: The title of the automation + updated_at: + type: string + format: date-time + description: The time of the last update of the automation + readOnly: true + example: + actions: + - field: priority + value: high + active: true + conditions: + all: + - field: status + operator: is + value: open + - field: priority + operator: less_than + value: high + any: [ ] + default: false + id: 9873843 + position: 8 + raw_title: Roger Wilco + title: Roger Wilco + AutomationResponse: + type: object + properties: + automation: + $ref: '#/components/schemas/AutomationObject' + AutomationsResponse: + type: object + properties: + automations: + type: array + items: + $ref: '#/components/schemas/AutomationObject' + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + BatchErrorItem: + type: object + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + trigger_id: + type: string + BatchJobRequest: + type: object + properties: + job: + type: object + properties: + action: + type: string + enum: + - patch + items: + type: object + properties: + trigger_categories: + type: array + items: + $ref: '#/components/schemas/TriggerCategoryBatchRequest' + triggers: + type: array + items: + $ref: '#/components/schemas/TriggerBatchRequest' + BatchJobResponse: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/BatchErrorItem' + results: + type: object + properties: + trigger_categories: + type: array + items: + $ref: '#/components/schemas/TriggerCategory' + triggers: + type: array + items: + $ref: '#/components/schemas/TriggerObject' + status: + type: string + enum: + - complete + - failed + BookmarkCreateRequest: + type: object + properties: + bookmark: + $ref: '#/components/schemas/BookmarkInput' + BookmarkInput: + type: object + properties: + ticket_id: + type: integer + description: The id of the ticket the bookmark is for. + BookmarkObject: + title: Bookmarks + type: object + properties: + created_at: + type: string + format: date-time + description: The time the bookmark was created + readOnly: true + id: + type: integer + description: Automatically assigned when the bookmark is created + readOnly: true + ticket: + type: object + allOf: + - $ref: '#/components/schemas/TicketObject' + readOnly: true + url: + type: string + description: The API url of this bookmark + readOnly: true + example: + created_at: "2014-11-20T22:55:29Z" + id: 35436 + ticket: + description: The fire is very colorful. + id: 60 + priority: high + requester_id: 156 + subject: Help, my printer is on fire! + url: https://{subdomain}.zendesk.com/api/v2/bookmarks/35436 + BookmarkResponse: + type: object + properties: + bookmark: + $ref: '#/components/schemas/BookmarkObject' + BookmarksResponse: + title: Bookmarks + type: object + allOf: + - $ref: '#/components/schemas/OffsetPaginationObject' + - type: object + properties: + bookmarks: + type: array + items: + $ref: '#/components/schemas/BookmarkObject' + BrandAgentObject: + type: object + properties: + brand_id: + type: integer + description: The id of a brand + created_at: + type: string + format: date-time + description: The time the brand membership was created + readOnly: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the brand membership + readOnly: true + url: + type: string + description: The API url of this record + readOnly: true + user_id: + type: integer + description: The id of an agent + required: + - user_id + - brand_id + BrandAgentResponse: + type: object + properties: + brand_agent: + $ref: '#/components/schemas/BrandAgentObject' + BrandAgentsResponse: + type: object + properties: + brand_agents: + type: array + items: + $ref: '#/components/schemas/BrandAgentObject' + BrandCreateRequest: + type: object + properties: + brand: + $ref: '#/components/schemas/BrandObject' + BrandObject: + title: Brands + type: object + properties: + active: + type: boolean + description: If the brand is set as active + brand_url: + type: string + description: The url of the brand + created_at: + type: string + format: date-time + description: The time the brand was created + readOnly: true + default: + type: boolean + description: Is the brand the default brand for this account + has_help_center: + type: boolean + description: If the brand has a Help Center + help_center_state: + type: string + description: The state of the Help Center + enum: + - enabled + - disabled + - restricted + readOnly: true + host_mapping: + type: string + description: The hostmapping to this brand, if any. Only admins view this property. + id: + type: integer + description: The ID automatically assigned when the brand is created + readOnly: true + is_deleted: + type: boolean + description: If the brand object is deleted or not + logo: + $ref: '#/components/schemas/AttachmentObject' + name: + type: string + description: The name of the brand + signature_template: + type: string + description: The signature template for a brand + subdomain: + type: string + description: The subdomain of the brand + ticket_form_ids: + type: array + description: The ids of ticket forms that are available for use by a brand + items: + type: integer + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the brand + readOnly: true + url: + type: string + description: The API url of this brand + readOnly: true + example: + active: true + brand_url: https://brand1.com + created_at: "2012-04-02T22:55:29Z" + default: true + has_help_center: true + help_center_state: enabled + host_mapping: brand1.com + id: 47 + logo: + content_type: image/png + content_url: https://company.zendesk.com/logos/brand1_logo.png + file_name: brand1_logo.png + id: 928374 + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_thumb.png + file_name: brand1_logo_thumb.png + id: 928375 + mapped_content_url: https://company.com/photos/brand1_logo_thumb.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928375 + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_small.png + file_name: brand1_logo_small.png + id: 928376 + mapped_content_url: https://company.com/photos/brand1_logo_small.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928376 + url: https://company.zendesk.com/api/v2/attachments/928374 + name: Brand 1 + signature_template: '{{agent.signature}}' + subdomain: brand1 + ticket_form_ids: + - 47 + - 33 + - 22 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/brands/47 + required: + - name + - subdomain + BrandResponse: + type: object + properties: + brand: + $ref: '#/components/schemas/BrandObject' + BrandUpdateRequest: + type: object + properties: + brand: + $ref: '#/components/schemas/BrandObject' + BrandsResponse: + title: Brands + type: object + allOf: + - $ref: '#/components/schemas/OffsetPaginationObject' + - type: object + properties: + brands: + type: array + description: Array of brands + items: + $ref: '#/components/schemas/BrandObject' + BulkSkillBasedRoutingAttributeValueJob: + type: object + properties: + action: + type: string + description: 'The action to perform on the attribute values. One of the following: "upsert", "update", "delete"' + readOnly: true + attributes: + type: object + description: The attribute values to update. See [Attribute Values](#attribute-values). `agent_skill_priority` is optional. If not provided, it keeps the current priority or defaults to `NORMAL` when adding new attribute values. + properties: + attribute_values: + type: array + items: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueObject' + items: + type: array + description: The list of agent ids + items: + type: integer + readOnly: true + required: + - action + - items + - attributes + BulkSkillBasedRoutingAttributeValuesRequest: + title: Bulk Skill Based Routing Attribute Values Job + type: object + properties: + job: + $ref: '#/components/schemas/BulkSkillBasedRoutingAttributeValueJob' + BulkUpdateDefaultCustomStatusRequest: + type: object + properties: + ids: + type: string + description: The comma-separated list of custom ticket status ids to be set as default for their status categories + BulkUpdateDefaultCustomStatusResponse: + type: object + ChannelFrameworkPushResultsResponse: + type: object + properties: + results: + type: array + description: An array of [result objects](#result-object) + items: + $ref: '#/components/schemas/ChannelFrameworkResultObject' + ChannelFrameworkResultObject: + type: object + properties: + external_resource_id: + type: string + description: The external ID of the resource, as passed in + readOnly: true + status: + $ref: '#/components/schemas/ChannelFrameworkResultStatusObject' + ChannelFrameworkResultStatusObject: + type: object + description: The status of the import for the indicated resource + properties: + code: + type: string + description: A code indicating the status of the import of the resource, as described in [status codes](#status-codes) + readOnly: true + description: + type: string + description: In the case of an exception, a description of the exception. Otherwise, not present. + readOnly: true + CollaboratorObject: + type: object + properties: + email: + type: string + format: email + name: + type: string + example: + email: someone@example.com + name: Someone Special + ComplianceDeletionStatusObject: + type: object + properties: + account_subdomain: + type: string + action: + type: string + application: + type: string + created_at: + type: string + executer_id: + type: integer + nullable: true + user_id: + type: integer + required: + - action + - application + - account_subdomain + - executer_id + - user_id + - created_at + ComplianceDeletionStatusesResponse: + type: object + properties: + compliance_deletion_statuses: + type: array + items: + $ref: '#/components/schemas/ComplianceDeletionStatusObject' + ConditionObject: + type: object + properties: + field: + type: string + description: The name of a ticket field + operator: + type: string + description: A comparison operator + value: + type: string + description: The value of a ticket field + ConditionsObject: + type: object + description: An object that describes the conditions under which the automation will execute. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + properties: + all: + type: array + description: Logical AND. Tickets must fulfill all of the conditions to be considered matching + items: + $ref: '#/components/schemas/ConditionObject' + any: + type: array + description: Logical OR. Tickets may satisfy any of the conditions to be considered matching + items: + $ref: '#/components/schemas/ConditionObject' + ConversationLogObject: + type: object + properties: + attachments: + type: array + description: A collection of attachments (image or file) associated with the event + items: + $ref: '#/components/schemas/AttachmentObject' + readOnly: true + author: + type: object + description: Object that describes the user who created the event + properties: + type: + type: string + description: Either user, agent, or bot + enum: + - user + - agent + - bot + readOnly: true + zen:sunco:user_id: + type: string + description: A Zendesk resource name prefix describing a messaging user + readOnly: true + zen:support:user_id: + type: integer + description: A Zendesk resource name prefix describing a Support user + readOnly: true + additionalProperties: true + content: + type: object + description: Object that describes the content of the message. The inner fields depends on the record type + additionalProperties: true + readOnly: true + created_at: + type: string + format: date-time + description: The timestamp of when this record was created + readOnly: true + id: + type: string + description: Unique record identifier + readOnly: true + metadata: + type: object + description: Various additional data that further describes this record + additionalProperties: true + readOnly: true + reference: + type: string + description: 'A Zendesk resource name value that uniquely identifies this record. Example: `zen:ticket_event:`' + readOnly: true + type: + type: string + description: 'The type of record, representing one of the conversational ticket events. Examples: `Comment` or `Messaging::ConversationMessage`' + readOnly: true + additionalProperties: true + example: + attachments: + - content_type: image/png + content_url: https://company.zendesk.com/attachments/token/123/?name=sample.png + deleted: false + file_name: sample.png + height: 128 + id: 8639388162331 + inline: false + mapped_content_url: https://company.zendesk.com/attachments/token/h123/?name=sample.png + size: 20331 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/attachments/token/333/?name=sample_thumb.png + deleted: false + file_name: sample_thumb.png + height: 80 + id: 8639488164605 + inline: false + mapped_content_url: https://company.zendesk.com/attachments/token/333/?name=sample_thumb.png + size: 10173 + url: https://company.zendesk.com/api/v2/attachments/86395 + width: 80 + url: https://company.zendesk.com/api/v2/attachments/13341 + width: 128 + author: + avatar_url: https://static.zdassets.com/web_widget/latest/default_avatar.png + display_name: Sample Owner + type: agent + zen:sunco:user_id: a21a91fd1234a + zen:support:user_id: 123111233 + content: + body:
big bear attachment public comment email
+ type: html + created_at: "2024-10-09T03:30:43Z" + id: 01J9Q342W4DE2G1343NNTX36G + metadata: + custom: { } + public: true + system: + client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) + ip_address: 123.45.67.89 + latitude: -30.3 + location: Sydney, NSW, Australia + longitude: 100.1 + ticket_version: 4 + reference: zen:ticket_event:8639326502654 + type: Comment + required: + - id + - type + - reference + - created_at + - author + - content + - metadata + - attachments + ConversationLogResponse: + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/ConversationLogObject' + links: + type: object + properties: + next: + type: string + prev: + type: string + meta: + type: object + properties: + after_cursor: + type: string + before_cursor: + type: string + has_more: + type: boolean + CountOrganizationObject: + type: object + properties: + refreshed_at: + type: string + readOnly: true + value: + type: integer + readOnly: true + CountOrganizationResponse: + type: object + properties: + count: + $ref: '#/components/schemas/CountOrganizationObject' + CountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + CreateOrganizationRequest: + type: object + properties: + organization: + $ref: '#/components/schemas/OrganizationObject' + required: + - organization + CreateResourceResult: + type: object + properties: + id: + type: integer + description: the id of the new resource + index: + type: integer + description: the index number of the resul + required: + - id + - index + CurrentUserResponse: + type: object + properties: + user: + allOf: + - $ref: '#/components/schemas/UserObject' + - type: object + properties: + authenticity_token: + type: string + description: CSRF token required by some Zendesk APIs. + readOnly: true + CursorBasedExportIncrementalTicketsResponse: + type: object + description: | + See [Tickets](/api-reference/ticketing/tickets/tickets/) for a detailed example. + properties: + after_cursor: + type: string + nullable: true + after_url: + type: string + nullable: true + before_cursor: + type: string + nullable: true + before_url: + type: string + nullable: true + end_of_stream: + type: boolean + tickets: + type: array + items: + $ref: '#/components/schemas/TicketObject' + example: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://{subdomain}.zendesk.com/api/v2/incremental/tickets/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + end_of_stream: true + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + CursorBasedExportIncrementalUsersResponse: + type: object + properties: + after_cursor: + type: string + nullable: true + after_url: + type: string + nullable: true + before_cursor: + type: string + nullable: true + before_url: + type: string + nullable: true + end_of_stream: + type: boolean + users: + type: array + items: + $ref: '#/components/schemas/UserObject' + example: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://example.zendesk.com/api/v2/incremental/users/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + end_of_stream: true + users: + - active: true + alias: Mr. Johnny + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + CursorPaginationMeta: + type: object + properties: + links: + type: object + properties: + next: + type: string + nullable: true + prev: + type: string + nullable: true + required: + - prev + - next + meta: + type: object + properties: + after_cursor: + type: string + nullable: true + before_cursor: + type: string + nullable: true + has_more: + type: boolean + required: + - has_more + - after_cursor + - before_cursor + CustomFieldObject: + type: object + properties: + active: + type: boolean + description: If true, this field is available for use + created_at: + type: string + format: date-time + description: The time the field was created + readOnly: true + custom_field_options: + type: array + description: Required and presented for a custom field of type "dropdown". Each option is represented by an object with a `name` and `value` property + items: + $ref: '#/components/schemas/CustomFieldOptionObject' + description: + type: string + description: User-defined description of this field's purpose + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + key: + type: string + description: A unique key that identifies this custom field. This is used for updating the field and referencing in placeholders. The key must consist of only letters, numbers, and underscores. It can't be only numbers + position: + type: integer + description: Ordering of the field relative to other fields + raw_description: + type: string + description: The dynamic content placeholder, if present, or the `description` value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_title: + type: string + description: The dynamic content placeholder, if present, or the `title` value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + regexp_for_validation: + type: string + description: Regular expression field only. The validation pattern for a field value to be deemed valid + nullable: true + relationship_filter: + type: object + description: A filter definition that allows your autocomplete to filter down results + system: + type: boolean + description: If true, only active and position values of this field can be changed + readOnly: true + tag: + type: string + description: Optional for custom field of type "checkbox"; not presented otherwise. + title: + type: string + description: The title of the custom field + type: + type: string + description: 'The custom field type: "checkbox", "date", "decimal", "dropdown", "integer", ["lookup"](/api-reference/ticketing/lookup_relationships/lookup_relationships/), "multiselect", "regexp", "text", or "textarea"' + updated_at: + type: string + format: date-time + description: The time of the last update of the field + readOnly: true + url: + type: string + description: The URL for this resource + readOnly: true + required: + - key + - type + - title + CustomFieldOptionObject: + type: object + properties: + allow_solving: + type: boolean + description: Whether selecting this option allows solving the ticket when the field is required to solve + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: Name of the dropdown option + position: + type: integer + description: Position of the dropdown option + raw_name: + type: string + description: Raw name of the dropdown option + readOnly: true + url: + type: string + description: URL of the dropdown option + readOnly: true + value: + type: string + description: Value of the dropdown option + required: + - name + - value + CustomFieldOptionResponse: + type: object + properties: + custom_field_option: + $ref: '#/components/schemas/CustomFieldOptionObject' + CustomFieldOptionsResponse: + type: object + properties: + count: + type: integer + description: Total count of records retrieved + readOnly: true + custom_field_options: + type: array + items: + $ref: '#/components/schemas/CustomFieldOptionObject' + next_page: + type: string + description: URL of the next page + nullable: true + readOnly: true + previous_page: + type: string + description: URL of the previous page + nullable: true + readOnly: true + CustomObject: + type: object + properties: + allows_attachments: + type: boolean + description: If true, file attachments can be added to the object's records. If false, new attachments can't be added to the object's records, but existing attachments on records can still be viewed and downloaded + allows_photos: + type: boolean + description: If true, photos can be uploaded to the records of the object. If false, new photos cannot be uploaded but existing photos can still be viewed and removed + created_at: + type: string + format: date-time + description: The time the object type was created + readOnly: true + created_by_user_id: + type: string + description: Id of a user who created the object + readOnly: true + description: + type: string + description: User-defined description of the object + include_in_list_view: + type: boolean + description: A flag setting the visibility of the object in the agent's list view. If true, all agents and admins have viewing access to the object in the Custom objects record page in the Agent Workspace. If false, only admins have viewing access + key: + type: string + description: A user-defined unique identifier. Writable on create only + readOnly: true + raw_description: + type: string + description: The dynamic content placeholder, if present, or the "raw_description" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_title: + type: string + description: The dynamic content placeholder, if present, or the "title" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_title_pluralized: + type: string + description: The dynamic content placeholder, if present, or the "raw_title_pluralized" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + title: + type: string + description: User-defined display name for the object + title_pluralized: + type: string + description: User-defined pluralized version of the object's title + updated_at: + type: string + format: date-time + description: The time of the last update of the object + readOnly: true + updated_by_user_id: + type: string + description: Id of the last user who updated the object + readOnly: true + url: + type: string + description: Direct link to the specific custom object + readOnly: true + required: + - key + - title + - title_pluralized + - include_in_list_view + CustomObjectCreateInput: + type: object + properties: + allows_attachments: + type: boolean + description: Whether this object allows file attachments + allows_photos: + type: boolean + description: Whether this object allows photo uploads + description: + type: string + description: A description of the custom object + include_in_list_view: + type: boolean + description: Whether to include this object in list views + key: + type: string + description: Unique identifier. Writable on create only + title: + type: string + description: Display name for the object + title_pluralized: + type: string + description: Pluralized version of the object's title + CustomObjectField: + type: object + allOf: + - $ref: '#/components/schemas/CustomFieldObject' + - type: object + properties: + properties: + $ref: '#/components/schemas/CustomObjectFieldPropertiesObject' + relationship_target_type: + type: string + description: A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", "zen:article", "zen:brand", and "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment". + required: + type: boolean + description: If true, the field must have a value when creating or updating custom object records. + example: + active: true + created_at: "2022-09-07T23:21:59Z" + description: Make + id: 4398096842879 + key: make + position: 0 + properties: + autoincrement_enabled: true + autoincrement_next_sequence: 1 + autoincrement_padding: 5 + autoincrement_prefix: 'Order # ' + is_unique: false + raw_description: Make + raw_title: Make + regexp_for_validation: null + required: false + system: false + title: Make + type: text + updated_at: "2022-09-07T23:22:00Z" + url: https://company.zendesk.com/api/v2/custom_objects/car/fields/4398096842879 + CustomObjectFieldPropertiesObject: + type: object + description: A set of properties which describe the standard::name field's autonumbering and uniqueness behavior. Autonumbering and uniqueness can't be used together + properties: + autoincrement_enabled: + type: boolean + description: Turns autonumbering on or off + autoincrement_next_sequence: + type: integer + description: The next number in the autonumbering sequence. It can't be negative or less than the current autonumbering value + autoincrement_padding: + type: integer + description: Sets the number of digits for autogenerated numbers. Valid values are 0-9 + autoincrement_prefix: + type: string + description: A prefix to autogenerated numbers that can't exceed 30 characters + is_unique: + type: boolean + description: Turns uniqueness on or off + example: + autoincrement_enabled: true + autoincrement_next_sequence: 1 + autoincrement_padding: 5 + autoincrement_prefix: 'Order # ' + is_unique: false + CustomObjectFieldResponse: + type: object + properties: + custom_object_field: + $ref: '#/components/schemas/CustomObjectField' + CustomObjectFieldsCreateRequest: + type: object + properties: + custom_object_field: + $ref: '#/components/schemas/CustomObjectField' + CustomObjectFieldsResponse: + type: object + properties: + custom_object_fields: + type: array + items: + $ref: '#/components/schemas/CustomObjectField' + CustomObjectLimitsResponse: + type: object + properties: + count: + type: integer + description: The current numnber of the requested resource + readOnly: true + limit: + type: integer + description: The maximum allowed number for the requested resource + readOnly: true + CustomObjectRecord: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the object was created + readOnly: true + created_by_user_id: + type: string + description: Id of a user who created the object + readOnly: true + custom_object_fields: + type: object + additionalProperties: true + custom_object_key: + type: string + description: A user-defined unique identifier + readOnly: true + external_id: + type: string + description: An id you can use to link custom object records to external data + nullable: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: User-defined display name for the object. If autonumbering is selected for the custom object's name field, the name isn't allowed because it's automatically generated. If uniqueness is enabled, the name must be unique. + readOnly: true + photo: + type: object + description: The record photo represented as an [Attachment](/api-reference/ticketing/tickets/ticket-attachments/). The `allows_photos` property must be set to true for the object. Record photos are publicly accessible via the photo `content_url`. + additionalProperties: true + nullable: true + updated_at: + type: string + format: date-time + description: The time of the last update of the object + readOnly: true + updated_by_user_id: + type: string + description: Id of the last user who updated the object + readOnly: true + url: + type: string + description: Direct link to the specific custom object + readOnly: true + required: + - name + CustomObjectRecordAttachment: + type: object + description: A file attachment associated with a custom object record + properties: + content_type: + type: string + description: The content type of the file + example: application/pdf + readOnly: true + content_url: + type: string + description: A full URL where the attachment file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. + example: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/attachments/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/download + readOnly: true + created_at: + type: string + format: date-time + description: The date and time when the attachment was created + example: "2024-01-15T14:30:00Z" + readOnly: true + created_by: + type: string + description: The name of the user who created the attachment + example: John Doe + readOnly: true + custom_object_record_id: + type: string + description: The ID of the custom object record this attachment belongs to + example: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + readOnly: true + filename: + type: string + description: The name of the attachment file + example: document.pdf + readOnly: true + id: + type: string + description: Automatically assigned when created + example: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + readOnly: true + malware_access_override: + type: boolean + description: If true, you can download an attachment flagged as malware. If false, you can't download such an attachment. + example: false + readOnly: true + malware_scan_completed_at: + type: string + format: date-time + description: The date and time when the malware scan was completed + example: "2024-01-15T14:30:00Z" + nullable: true + readOnly: true + malware_scan_status: + type: string + description: The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. + enum: + - malware_found + - malware_not_found + - failed_to_scan + - not_scanned + example: malware_not_found + readOnly: true + size: + type: integer + description: The size of the file in bytes + example: 245760 + readOnly: true + CustomObjectRecordAttachmentResponse: + type: object + properties: + custom_object_record_attachment: + $ref: '#/components/schemas/CustomObjectRecordAttachment' + CustomObjectRecordAttachmentUpdateRequest: + type: object + properties: + custom_object_record_attachment: + type: object + properties: + malware_access_override: + type: boolean + description: If true, allows access to an attachment flagged as malware. If false, blocks access to such an attachment. + example: true + required: + - malware_access_override + required: + - custom_object_record_attachment + CustomObjectRecordAttachmentsResponse: + type: object + properties: + custom_object_record_attachments: + type: array + items: + $ref: '#/components/schemas/CustomObjectRecordAttachment' + CustomObjectRecordFilteredSearchCondition: + type: object + properties: + field_key: + type: object + properties: + operator: + type: string + value: + oneOf: + - type: string + - type: integer + - type: array + items: + oneOf: + - type: string + - type: integer + example: + operator: value + nullable: true + additionalProperties: true + CustomObjectRecordResponse: + type: object + properties: + custom_object_record: + $ref: '#/components/schemas/CustomObjectRecord' + CustomObjectRecordsBulkCreateRequest: + type: object + properties: + job: + type: object + properties: + action: + type: string + items: + type: array + description: An array of record objects for job actions that create, update, or set. An array of strings for job actions that delete. + items: + oneOf: + - $ref: '#/components/schemas/CustomObjectRecord' + - type: string + CustomObjectRecordsCreateRequest: + type: object + properties: + custom_object_record: + $ref: '#/components/schemas/CustomObjectRecord' + CustomObjectRecordsFilteredSearchRequestBasic: + type: object + properties: + filter: + $ref: '#/components/schemas/CustomObjectRecordFilteredSearchCondition' + CustomObjectRecordsFilteredSearchRequestComplex: + type: object + properties: + filter: + type: object + properties: + $and: + type: array + items: + $ref: '#/components/schemas/CustomObjectRecordFilteredSearchCondition' + $or: + type: array + items: + $ref: '#/components/schemas/CustomObjectRecordFilteredSearchCondition' + CustomObjectRecordsJobsResponse: + type: object + properties: + job_status: + type: object + properties: + id: + type: string + message: + type: string + nullable: true + progress: + type: integer + nullable: true + results: + type: array + items: + $ref: '#/components/schemas/CustomObjectRecord' + nullable: true + status: + type: string + total: + type: integer + url: + type: string + CustomObjectRecordsResponse: + type: object + properties: + count: + type: integer + description: The number of results returned for the current request + readOnly: true + custom_object_records: + type: array + items: + $ref: '#/components/schemas/CustomObjectRecord' + links: + type: object + properties: + next: + type: string + nullable: true + prev: + type: string + nullable: true + required: + - prev + - next + meta: + type: object + properties: + after_cursor: + type: string + nullable: true + before_cursor: + type: string + nullable: true + has_more: + type: boolean + required: + - has_more + - after_cursor + - before_cursor + CustomObjectRecordsUpsertRequest: + type: object + properties: + custom_object_record: + $ref: '#/components/schemas/CustomObjectRecord' + CustomObjectResponse: + type: object + properties: + custom_object: + $ref: '#/components/schemas/CustomObject' + CustomObjectsCreateRequest: + type: object + properties: + custom_object: + $ref: '#/components/schemas/CustomObjectCreateInput' + CustomObjectsResponse: + type: object + properties: + custom_objects: + type: array + items: + $ref: '#/components/schemas/CustomObject' + CustomRoleConfigurationObject: + type: object + description: Configuration settings for the role. See [Configuration](#configuration) + properties: + assign_tickets_to_any_group: + type: boolean + description: Whether or not the agent can assign tickets to any group + readOnly: true + chat_access: + type: boolean + description: Whether or not the agent has access to Chat + readOnly: true + end_user_list_access: + type: string + description: 'Whether or not the agent can view lists of user profiles. Allowed values: "full", "none"' + end_user_profile_access: + type: string + description: 'What the agent can do with end-user profiles. Allowed values: "edit", "edit-within-org", "full", "readonly"' + explore_access: + type: string + description: 'Allowed values: "edit", "full", "none", "readonly"' + export_views: + type: boolean + description: Whether or not the agent can export views + forum_access: + type: string + description: 'The kind of access the agent has to Guide. Allowed values: "edit-topics", "full", "readonly"' + forum_access_restricted_content: + type: boolean + group_access: + type: boolean + description: Whether or not the agent can add or modify groups + readOnly: true + light_agent: + type: boolean + readOnly: true + macro_access: + type: string + description: 'What the agent can do with macros. Allowed values: "full", "manage-group", "manage-personal", "readonly"' + manage_business_rules: + type: boolean + description: Whether or not the agent can manage business rules + manage_contextual_workspaces: + type: boolean + description: Whether or not the agent can view, add, and edit contextual workspaces + manage_dynamic_content: + type: boolean + description: Whether or not the agent can access dynamic content + manage_extensions_and_channels: + type: boolean + description: Whether or not the agent can manage channels and extensions + manage_facebook: + type: boolean + description: Whether or not the agent can manage Facebook pages + manage_organization_fields: + type: boolean + description: Whether or not the agent can create and manage organization fields + manage_ticket_fields: + type: boolean + description: Whether or not the agent can create and manage ticket fields + manage_ticket_forms: + type: boolean + description: Whether or not the agent can create and manage ticket forms + manage_user_fields: + type: boolean + description: Whether or not the agent can create and manage user fields + moderate_forums: + type: boolean + readOnly: true + organization_editing: + type: boolean + description: Whether or not the agent can add or modify organizations + organization_notes_editing: + type: boolean + description: Whether or not the agent can add or modify organization notes + readOnly: true + report_access: + type: string + description: 'What the agent can do with reports. Allowed values: "full", "none", "readonly"' + side_conversation_create: + type: boolean + description: Whether or not the agent can contribute to side conversations + ticket_access: + type: string + description: 'What kind of tickets the agent can access. Allowed values: "all", "assigned-only", "within-groups", "within-groups-and-public-groups", "within-organization"' + ticket_comment_access: + type: string + description: 'What type of comments the agent can make. Allowed values: "public", "none"' + ticket_deletion: + type: boolean + description: Whether or not the agent can delete tickets + ticket_editing: + type: boolean + description: Whether or not the agent can edit ticket properties + ticket_merge: + type: boolean + description: Whether or not the agent can merge tickets + ticket_tag_editing: + type: boolean + description: Whether or not the agent can edit ticket tags + twitter_search_access: + type: boolean + user_view_access: + type: string + description: 'What the agent can do with customer lists. Allowed values: "full", "manage-group", "manage-personal", "none", "readonly"' + view_access: + type: string + description: 'What the agent can do with views. Allowed values: "full", "manage-group", "manage-personal", "playonly", "readonly"' + view_access_logs: + type: boolean + description: Whether or not the agent can view access logs. + view_audit_logs: + type: boolean + description: Whether or not the agent can view audit logs. + view_deleted_tickets: + type: boolean + description: Whether or not the agent can view deleted tickets + view_filter_tickets: + type: boolean + description: Whether or not the agent can view and apply filters to tickets + voice_access: + type: boolean + description: Whether or not the agent can answer and place calls to end users + voice_dashboard_access: + type: boolean + description: Whether or not the agent can view details about calls on the Talk dashboard + CustomRoleObject: + title: Custom Agent Roles + type: object + properties: + configuration: + $ref: '#/components/schemas/CustomRoleConfigurationObject' + created_at: + type: string + format: date-time + description: The time the record was created + readOnly: true + description: + type: string + description: A description of the role + id: + type: integer + description: Automatically assigned on creation + readOnly: true + name: + type: string + description: Name of the custom role + role_type: + type: integer + description: The user's role. 0 stands for a custom agent, 1 for a light agent, 2 for a chat agent, 3 for a contributor, 4 for an admin and 5 for a billing admin. See [Understanding standard agent roles in Zendesk Support](https://support.zendesk.com/hc/en-us/articles/4409155971354-Understanding-standard-agent-roles-in-Zendesk-Support) in Zendesk help + readOnly: true + team_member_count: + type: integer + description: The number of team members assigned to this role + readOnly: true + updated_at: + type: string + format: date-time + description: The time the record was last updated + readOnly: true + required: + - name + - role_type + CustomRoleResponse: + type: object + properties: + custom_role: + $ref: '#/components/schemas/CustomRoleObject' + CustomRolesResponse: + type: object + properties: + custom_roles: + type: array + items: + $ref: '#/components/schemas/CustomRoleObject' + CustomStatusCreateInput: + type: object + allOf: + - $ref: '#/components/schemas/CustomStatusUpdateInput' + - type: object + properties: + status_category: + type: string + description: The status category the custom ticket status belongs to + enum: + - new + - open + - pending + - hold + - solved + CustomStatusCreateRequest: + type: object + properties: + custom_status: + $ref: '#/components/schemas/CustomStatusCreateInput' + CustomStatusObject: + type: object + properties: + active: + type: boolean + description: If true, the custom status is set to active, If false, the custom status is set to inactive + agent_label: + type: string + description: The label displayed to agents. Maximum length is 48 characters + created_at: + type: string + format: date-time + description: The date and time the custom ticket status was created + readOnly: true + default: + type: boolean + description: If true, the custom status is set to default. If false, the custom status is set to non-default + description: + type: string + description: The description of when the user should select this custom ticket status + end_user_description: + type: string + description: The description displayed to end users + end_user_label: + type: string + description: The label displayed to end users. Maximum length is 48 characters + id: + type: integer + description: Automatically assigned when the custom ticket status is created + readOnly: true + raw_agent_label: + type: string + description: The dynamic content placeholder. If the dynamic content placeholder is not available, this is the "agent_label" value. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + readOnly: true + raw_description: + type: string + description: The dynamic content placeholder. If the dynamic content placeholder is not available, this is the "description" value. [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + readOnly: true + raw_end_user_description: + type: string + description: The dynamic content placeholder. If the dynamic content placeholder is not available, this is the "end_user_description" value. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + readOnly: true + raw_end_user_label: + type: string + description: The dynamic content placeholder. If the dynamic content placeholder is not available, this is the "end_user_label" value. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + readOnly: true + status_category: + type: string + description: The status category the custom ticket status belongs to + enum: + - new + - open + - pending + - hold + - solved + updated_at: + type: string + format: date-time + description: The date and time the custom ticket status was last updated + readOnly: true + required: + - status_category + - agent_label + CustomStatusResponse: + type: object + properties: + custom_status: + $ref: '#/components/schemas/CustomStatusObject' + CustomStatusUpdateInput: + type: object + properties: + active: + type: boolean + description: True if the custom status is set as active; inactive if false + agent_label: + type: string + description: The dynamic content placeholder, if present, or the "agent_label" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + description: + type: string + description: The dynamic content placeholder, if present, or the "description" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + end_user_description: + type: string + description: The dynamic content placeholder, if present, or the "end_user_description" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + end_user_label: + type: string + description: The dynamic content placeholder, if present, or the "end_user_label" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + CustomStatusUpdateRequest: + type: object + properties: + custom_status: + $ref: '#/components/schemas/CustomStatusUpdateInput' + CustomStatusesResponse: + type: object + properties: + custom_statuses: + type: array + items: + $ref: '#/components/schemas/CustomStatusObject' + DefinitionsResponse: + type: object + properties: + definitions: + type: object + properties: + conditions_all: + type: array + items: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + conditions_any: + type: array + items: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + DeletedUserObject: + type: object + properties: + active: + type: boolean + created_at: + type: string + email: + type: string + id: + type: integer + locale: + type: string + locale_id: + type: integer + name: + type: string + organization_id: + type: integer + phone: + type: string + nullable: true + photo: + type: object + nullable: true + role: + type: string + shared_phone_number: + type: string + nullable: true + time_zone: + type: string + updated_at: + type: string + url: + type: string + required: + - id + - url + - name + - email + - created_at + - updated_at + - time_zone + - phone + - shared_phone_number + - photo + - locale_id + - locale + - organization_id + - role + - active + DeletedUserResponse: + type: object + properties: + deleted_user: + $ref: '#/components/schemas/DeletedUserObject' + DeletedUsersResponse: + type: object + properties: + deleted_users: + type: array + items: + $ref: '#/components/schemas/DeletedUserObject' + DeletionSchedule: + type: object + properties: + active: + type: boolean + description: Whether the deletion schedule is active + conditions: + $ref: '#/components/schemas/ConditionsObject' + created_at: + type: string + format: date-time + description: The time the deletion schedule was created + readOnly: true + default: + type: boolean + description: Whether the deletion schedule is the default + readOnly: true + description: + type: string + description: The description of the deletion schedule + id: + type: integer + description: The id of the deletion schedule + readOnly: true + object: + type: string + description: Represents the entity the schedule will delete. Cannot be modified after schedule creation. Can be one of `'zen:ticket'`, `'zen:user'`, `'zen:attachment'`, `'zen:bot_only_conversation'`, or `'zen:custom_object:CUSTOM_OBJECT_KEY'`. + title: + type: string + description: The title of the deletion schedule + updated_at: + type: string + format: date-time + description: The time the deletion schedule was last updated + readOnly: true + url: + type: string + description: Url for obtaining the deletion schedule JSON + readOnly: true + DynamicContentObject: + title: Dynamic Content Items + type: object + properties: + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + default_locale_id: + type: integer + description: The default locale for the item. Must be one of the [locales the account has active](/api-reference/ticketing/account-configuration/locales/#list-locales). + id: + type: integer + description: Automatically assigned when creating items + readOnly: true + name: + type: string + description: The unique name of the item + outdated: + type: boolean + description: Indicates the item has outdated variants within it + readOnly: true + placeholder: + type: string + description: Automatically generated placeholder for the item, derived from name + readOnly: true + updated_at: + type: string + format: date-time + description: When this record was last updated + readOnly: true + url: + type: string + description: The API url of this item + readOnly: true + variants: + type: array + description: All variants within this item. See [Dynamic Content Item Variants](/api-reference/ticketing/ticket-management/dynamic_content_item_variants/) + items: + $ref: '#/components/schemas/DynamicContentVariantObject' + required: + - name + - default_locale_id + - variants + DynamicContentResponse: + type: object + properties: + item: + $ref: '#/components/schemas/DynamicContentObject' + DynamicContentVariantObject: + type: object + properties: + active: + type: boolean + description: If the variant is active and usable + content: + type: string + description: The content of the variant + created_at: + type: string + format: date-time + description: When the variant was created + readOnly: true + default: + type: boolean + description: If the variant is the default for the item it belongs to + id: + type: integer + description: Automatically assigned when the variant is created + readOnly: true + locale_id: + type: integer + description: An active locale + outdated: + type: boolean + description: If the variant is outdated + readOnly: true + updated_at: + type: string + format: date-time + description: When the variant was last updated + readOnly: true + url: + type: string + description: The API url of the variant + readOnly: true + example: + active: true + content: This is my dynamic content in English + created_at: "2014-04-09T19:53:23Z" + default: true + id: 23 + locale_id: 125 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + required: + - content + - locale_id + DynamicContentVariantResponse: + type: object + properties: + variant: + $ref: '#/components/schemas/DynamicContentVariantObject' + DynamicContentVariantsResponse: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/DynamicContentVariantObject' + DynamicContentsResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DynamicContentObject' + EmailCCObject: + type: object + allOf: + - $ref: '#/components/schemas/FollowerObject' + - type: object + properties: + action: + type: string + enum: + - put + - delete + user_email: + type: string + user_id: + type: integer + format: bigid + user_name: + type: string + EmailNotificationObject: + type: object + properties: + comment_id: + type: integer + description: The comment ID associated to this email notification + readOnly: true + created_at: + type: string + format: date-time + description: When this email notification was created + readOnly: true + email_id: + type: string + description: The email ID of this email notification + readOnly: true + message_id: + type: string + description: The value of the Message-Id header of the email + readOnly: true + notification_id: + type: integer + description: The notification id of this email notification + readOnly: true + recipients: + type: array + description: The list of recipients associated to this email notification + items: + $ref: '#/components/schemas/RecipientObject' + readOnly: true + ticket_id: + type: integer + description: The ticket ID associated to this email notification + readOnly: true + updated_at: + type: string + format: date-time + description: When this email notification was last updated + readOnly: true + url: + type: string + description: The API url of this email notification + readOnly: true + example: + comment_id: 7824075373565 + created_at: "2024-02-21T23:13:07Z" + email_id: 01HQ6Z3DE28F34XBFCYH0SRM95 + message_id: <56Z97D7G67G_65d68382aa493_4639581606f3@example.com> + notification_id: 7824075373693 + recipients: + - delivery_status: + code: 530 5.7.0 + id: 24 + message: 'Email failed to deliver. Status code: 530' + name: authentication_required + email_address: recipient@example.com + user_id: 7612709251581 + ticket_id: 623 + updated_at: "2024-02-21T23:13:07Z" + url: https://example.zendesk.com/api/v2/email_notifications/7824075373693 + EmailNotificationResponse: + type: object + properties: + email_notification: + $ref: '#/components/schemas/EmailNotificationObject' + EmailNotificationsResponse: + type: object + properties: + email_notifications: + type: array + items: + $ref: '#/components/schemas/EmailNotificationObject' + Error: + type: object + properties: + code: + type: string + detail: + type: string + id: + type: string + links: + type: object + source: + type: object + status: + type: string + title: + type: string + required: + - code + - title + Errors: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Error' + EssentialsCardObject: + type: object + properties: + created_at: + type: string + format: date-time + description: Date and time the essentials card were created + readOnly: true + default: + type: boolean + description: If true, the system has used the first twenty fields for the custom object type as the essentials card. + readOnly: true + fields: + type: array + description: Fields that are displayed in the essentials card details. The order is defined by the order of the fields in the array + items: + type: object + additionalProperties: true + id: + type: string + description: | + id of the essentials card + nullable: true + readOnly: true + key: + type: string + description: | + Object type. Example: `zen:user` refers to `User` type + readOnly: true + layout: + type: string + description: | + layout type + readOnly: true + max_count: + type: integer + description: Maximum number of fields allowed in the essentials card + readOnly: true + updated_at: + type: string + format: date-time + description: Date and time the essentials card were last updated + readOnly: true + example: + created_at: "2012-04-02T22:55:29Z" + default: true + fields: + - id: null + zrn: zen:user:identity:email + - id: null + zrn: zen:user:field:standard:external_id + - id: null + zrn: zen:user:field:standard:iana_time_zone + - id: null + zrn: zen:user:field:standard:locale + - id: null + zrn: zen:user:field:standard:organization_id + id: "123" + key: zen:custom_object:boat + layout: essentials_card + max_count: 20 + updated_at: "2012-04-02T22:55:29Z" + required: + - fields + EssentialsCardResponse: + type: object + properties: + object_layout: + $ref: '#/components/schemas/EssentialsCardObject' + EssentialsCardsResponse: + type: object + properties: + object_layouts: + type: array + items: + $ref: '#/components/schemas/EssentialsCardObject' + ExportIncrementalOrganizationsResponse: + type: object + properties: + count: + type: integer + end_of_stream: + type: boolean + end_time: + type: integer + next_page: + type: string + nullable: true + organizations: + type: array + items: + $ref: '#/components/schemas/OrganizationObject' + example: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + organizations: + - created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: ABC198 + group_id: 1835962 + id: 4112492 + name: Groablet Enterprises + notes: donkey + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + ExportIncrementalTicketEventsResponse: + type: object + properties: + count: + type: integer + end_of_stream: + type: boolean + end_time: + type: integer + next_page: + type: string + nullable: true + ticket_events: + type: array + items: + $ref: '#/components/schemas/TicketMetricEventBaseObject' + example: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + ticket_events: + - id: 926256957613 + instance_id: 1 + metric: agent_work_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: measure + FailedResult: + type: object + properties: + action: + type: string + description: 'The action the job attempted (`"action": "update"`)' + details: + type: string + description: The details of the error + error: + type: string + description: The error message + id: + type: integer + description: The id of the resource the job attempted to update + success: + type: boolean + description: 'Whether the action was successful or not (`"success": true`)' + required: + - id + - action + - error + - success + - details + FeaturesResponse: + type: object + properties: + features: + type: object + description: A hash of feature names to their enabled status + additionalProperties: + properties: + enabled: + description: Whether the feature is enabled for the account + type: boolean + type: object + FollowerObject: + type: object + properties: + action: + type: string + enum: + - put + - delete + user_email: + type: string + format: email + user_id: + type: integer + format: bigid + user_name: + type: string + nullable: true + GlobalClientObject: + title: Global OAuth Clients + type: object + properties: + company: + type: string + description: The company that users are asked to approve access to + readOnly: true + description: + type: string + description: A short description of the client + readOnly: true + id: + type: integer + description: Automatically assigned when the client is created + readOnly: true + identifier: + type: string + description: The unique identifier for the client + readOnly: true + kind: + type: string + description: The kind of client, public or confidential + readOnly: true + logo_url: + type: string + description: The API logo url of this record + readOnly: true + name: + type: string + description: The name of the client + readOnly: true + example: + company: Zendesk + description: Zendesk global Client + id: 1 + identifier: global_client + kind: public + logo_url: https://example.com/logo + name: Global Client + GlobalClientResponse: + type: object + properties: + global_client: + $ref: '#/components/schemas/GlobalClientObject' + GlobalClientTokenSummaryObject: + title: Global OAuth Clients Token Summary + type: object + properties: + id: + type: integer + description: Automatically assigned when the client is created + readOnly: true + last_used_at: + type: string + description: Date and time in ISO 8601 format of last token usage for a client + readOnly: true + tokens_count: + type: integer + description: Account tokens count for client + readOnly: true + example: + id: 1 + last_used_at: "2024-06-07T15:46:32Z" + tokens_count: 123 + GlobalClientsResponse: + type: object + properties: + global_clients: + type: array + items: + $ref: '#/components/schemas/GlobalClientObject' + GlobalClientsTokenSummaryResponse: + type: object + properties: + global_clients: + type: array + items: + $ref: '#/components/schemas/GlobalClientTokenSummaryObject' + GroupMembershipObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the group was created + readOnly: true + default: + type: boolean + description: If true, tickets assigned directly to the agent will assume this membership's group + group_id: + type: integer + description: The id of a group + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the group + readOnly: true + url: + type: string + description: The API url of this record + readOnly: true + user_id: + type: integer + description: The id of an agent + required: + - user_id + - group_id + GroupMembershipResponse: + type: object + properties: + group_membership: + $ref: '#/components/schemas/GroupMembershipObject' + GroupMembershipsResponse: + type: object + properties: + group_memberships: + type: array + items: + $ref: '#/components/schemas/GroupMembershipObject' + GroupObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the group was created + readOnly: true + default: + type: boolean + description: If the group is the default one for the account + readOnly: true + deleted: + type: boolean + description: Deleted groups get marked as such + readOnly: true + description: + type: string + description: The description of the group + id: + type: integer + description: Automatically assigned when creating groups + readOnly: true + is_public: + type: boolean + description: | + If true, the group is public. + If false, the group is private. + You can't change a private group to a public group + name: + type: string + description: The name of the group + updated_at: + type: string + format: date-time + description: The time of the last update of the group + readOnly: true + url: + type: string + description: The API url of the group + readOnly: true + example: + created_at: "2009-07-20T22:55:29Z" + default: true + deleted: false + description: Some clever description here + id: 3432 + is_public: true + name: First Level Support + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/groups/3432 + required: + - name + GroupResponse: + type: object + properties: + group: + $ref: '#/components/schemas/GroupObject' + GroupSLAPoliciesResponse: + type: object + properties: + count: + type: integer + readOnly: true + group_sla_policies: + type: array + items: + $ref: '#/components/schemas/GroupSLAPolicyObject' + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + GroupSLAPolicyFilterConditionObject: + type: object + properties: + field: + type: string + description: The name of a ticket field + operator: + type: string + description: A comparison operator + value: + type: array + description: The value of a ticket field + items: + oneOf: + - type: string + - type: integer + GroupSLAPolicyFilterDefinitionResponse: + type: object + properties: + definitions: + type: object + properties: + all: + type: array + items: + type: object + properties: + group: + type: string + operators: + type: array + items: + type: object + properties: + title: + type: string + value: + type: string + title: + type: string + value: + type: string + values: + type: object + properties: + list: + type: array + items: + type: object + properties: + title: + type: string + value: + type: integer + nullable: true + type: + type: string + GroupSLAPolicyFilterObject: + type: object + description: An object that describes the conditions a ticket must match for a Group SLA policy to be applied to the ticket. See [Filter](#filter). + properties: + all: + type: array + items: + $ref: '#/components/schemas/GroupSLAPolicyFilterConditionObject' + GroupSLAPolicyMetricObject: + type: object + properties: + business_hours: + type: boolean + description: Whether the metric targets are being measured in business hours or calendar hours + metric: + type: string + description: The definition of the time that is being measured + priority: + type: string + description: Priority that a ticket must match + target: + type: integer + description: The time within which the end-state for a metric should be met + GroupSLAPolicyObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the Group SLA policy was created + readOnly: true + description: + type: string + description: The description of the Group SLA policy + filter: + $ref: '#/components/schemas/GroupSLAPolicyFilterObject' + id: + type: string + description: Automatically assigned when created + readOnly: true + policy_metrics: + type: array + description: Array of [policy metric](#policy-metric) objects + items: + $ref: '#/components/schemas/GroupSLAPolicyMetricObject' + position: + type: integer + description: Position of the Group SLA policy. This position determines the order in which policies are matched to tickets. If not specified, the Group SLA policy is added at the last position + title: + type: string + description: The title of the Group SLA policy + updated_at: + type: string + format: date-time + description: The time of the last update of the Group SLA policy + readOnly: true + url: + type: string + description: URL of the Group SLA policy record + readOnly: true + example: + created_at: "2023-03-17T22:50:26Z" + description: 'Group: Tier 1' + filter: + all: [ ] + id: 01H078CBDY28BZG7P6BONY09DN + policy_metrics: + - business_hours: false + metric: group_ownership_time + priority: low + target: 3600 + position: 3 + title: Tier 1 + updated_at: "2023-03-17T22:50:26Z" + url: https://company.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN + required: + - title + - filter + GroupSLAPolicyResponse: + type: object + properties: + group_sla_policy: + $ref: '#/components/schemas/GroupSLAPolicyObject' + GroupsCountObject: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + description: Timestamp that indicates when the count was last updated + readOnly: true + value: + type: integer + description: Approximate count of groups + readOnly: true + GroupsResponse: + type: object + properties: + groups: + type: array + items: + $ref: '#/components/schemas/GroupObject' + HostMappingObject: + title: Host Mapping + type: object + properties: + cname: + type: string + description: The canonical name record for a host mapping + expected_cnames: + type: array + description: Array of expected CNAME records for host mapping(s) of a given brand + items: + type: string + is_valid: + type: boolean + description: Whether a host mapping is valid or not for a given brand + reason: + type: string + description: Reason why a host mapping is valid or not + example: + cname: google.com + expected_cnames: + - bar.zendesk.coom + is_valid: false + reason: wrong_cname + IncrementalCustomObjectRecordsResponse: + type: object + description: | + Response for incremental export of custom object records. See [Custom Object Records](/api-reference/custom-data/custom-objects/custom_object_records/) for detailed information about custom object record properties. + properties: + after_cursor: + type: string + description: Cursor value for the next page. Use this value for the cursor parameter in the next request. + nullable: true + after_url: + type: string + description: URL to fetch the next page of results. Null if this is the last page. + nullable: true + before_cursor: + type: string + description: Cursor value for the previous page. Null if this is the first page. + nullable: true + before_url: + type: string + description: URL to fetch the previous page of results. Null if this is the first page. + nullable: true + custom_object_records: + type: array + description: Array of custom object records that have changed since the start time. + items: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the object was created + readOnly: true + created_by_user_id: + type: string + description: Id of a user who created the object + readOnly: true + custom_object_fields: + type: object + description: Custom field values. For deleted records, field values will be "[DELETED]" unless exclude_deleted filter is used. + additionalProperties: true + custom_object_key: + type: string + description: A user-defined unique identifier for the custom object + readOnly: true + external_id: + type: string + description: An id you can use to link custom object records to external data + nullable: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: User-defined display name for the object. May be "[DELETED]" for deleted records. + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the object + readOnly: true + updated_by_user_id: + type: string + description: Id of the last user who updated the object + readOnly: true + url: + type: string + description: Direct link to the specific custom object record + readOnly: true + filter: + type: object + description: Applied filters for the export + properties: + exclude_deleted: + type: boolean + description: Whether deleted records were excluded from the export + nullable: true + meta: + type: object + description: Metadata about the export operation + properties: + has_more: + type: boolean + description: Indicates whether there are more records to export after this page + example: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://company.zendesk.com/api/v2/incremental/custom_objects/my_object/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + custom_object_records: + - created_at: "2023-01-15T10:30:00Z" + created_by_user_id: "12345" + custom_object_fields: + description: This is a sample custom object record + priority: high + status: active + custom_object_key: my_object + external_id: ext-123 + id: 01HXAMPLE123456789 + name: Sample Record + updated_at: "2023-01-15T14:45:00Z" + updated_by_user_id: "12345" + url: https://company.zendesk.com/api/v2/custom_objects/my_object/records/01HXAMPLE123456789 + filter: + exclude_deleted: false + meta: + has_more: false + IncrementalSkillBasedRouting: + title: Incremental Skill-based Routing + type: object + properties: + attribute_values: + type: array + description: Routing attribute values + items: + $ref: '#/components/schemas/IncrementalSkillBasedRoutingAttributeValue' + attributes: + type: array + description: Routing attributes + items: + $ref: '#/components/schemas/IncrementalSkillBasedRoutingAttribute' + count: + type: integer + description: The number of results returned for the current request + readOnly: true + end_time: + type: integer + description: The most recent resource creation time present in this result set in Unix epoch time + readOnly: true + instance_values: + type: array + description: Routing instance values + items: + $ref: '#/components/schemas/IncrementalSkillBasedRoutingInstanceValue' + next_page: + type: string + description: The URL that should be called to get the next set of results + readOnly: true + IncrementalSkillBasedRoutingAttribute: + type: object + properties: + id: + type: string + description: Automatically assigned when an attribute is created + readOnly: true + name: + type: string + description: The name of the attribute + readOnly: true + time: + type: string + format: date-time + description: The time the attribute was created, updated, or deleted + readOnly: true + type: + type: string + description: One of "create", "update", or "delete" + readOnly: true + IncrementalSkillBasedRoutingAttributeValue: + type: object + properties: + attribute_id: + type: string + description: Id of the associated attribute + readOnly: true + id: + type: string + description: Automatically assigned when an attribute value is created + readOnly: true + name: + type: string + description: The name of the attribute value + readOnly: true + time: + type: string + format: date-time + description: The time the attribute value was created, updated, or deleted + readOnly: true + type: + type: string + description: One of "create", "update", or "delete" + readOnly: true + IncrementalSkillBasedRoutingInstanceValue: + type: object + properties: + attribute_value_id: + type: string + description: Id of the associated attribute value + readOnly: true + id: + type: string + description: Automatically assigned when an instance value is created + readOnly: true + instance_id: + type: string + description: Id of the associated agent or ticket + readOnly: true + time: + type: string + format: date-time + description: The time the instance value was created or deleted + readOnly: true + type: + type: string + description: One of "associate_agent", "unassociate_agent", "associate_ticket", or "unassociate_ticket" + readOnly: true + ItamAsset: + type: object + properties: + asset_tag: + type: string + description: The tag for the asset + nullable: true + asset_type_id: + type: string + description: Id of the asset type + readOnly: true + created_at: + type: string + format: date-time + description: The time the asset record was added + readOnly: true + custom_field_values: + type: object + description: User-defined custom asset fields and values + additionalProperties: true + external_id: + type: string + description: An id you can use to link an asset to external data + nullable: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + location_id: + type: string + description: Id of the asset location + nullable: true + manufacturer: + type: string + description: The asset's manufacturer name + nullable: true + model: + type: string + description: The asset's model name + nullable: true + name: + type: string + description: Display name for the asset + notes: + type: string + description: The asset's notes + nullable: true + organization_id: + type: integer + description: Id of the organization the asset is associated with + nullable: true + purchase_cost: + type: number + format: float + description: The asset's purchase cost + nullable: true + purchase_date: + type: string + format: date + description: The asset's purchase date + nullable: true + serial_number: + type: string + description: The asset's serial number + nullable: true + status_id: + type: string + description: Id of current status of the asset + updated_at: + type: string + format: date-time + description: The time of the asset's last update + readOnly: true + url: + type: string + description: Direct link to the specific asset + readOnly: true + user_id: + type: integer + description: Id of the user the asset is assigned to + nullable: true + vendor: + type: string + description: The asset's vendor name + nullable: true + warranty_expiration: + type: string + format: date + description: The asset's warranty expiration date + nullable: true + required: + - name + - status_id + - asset_type_id + ItamAssetBulkJobRequest: + type: object + properties: + job: + type: object + properties: + action: + type: string + enum: + - create + - update + - delete + - delete_by_external_id + items: + type: array + description: An array of asset objects for job actions that create or update. An array of strings for job actions that delete. + items: + oneOf: + - $ref: '#/components/schemas/ItamAsset' + - type: string + ItamAssetBulkJobResponse: + type: object + properties: + job_status: + type: object + properties: + id: + type: string + message: + type: string + nullable: true + progress: + type: integer + nullable: true + results: + type: array + items: + $ref: '#/components/schemas/ItamAsset' + nullable: true + status: + type: string + total: + type: integer + url: + type: string + ItamAssetCreateRequest: + type: object + properties: + asset: + $ref: '#/components/schemas/ItamAsset' + ItamAssetField: + type: object + allOf: + - $ref: '#/components/schemas/CustomObjectField' + ItamAssetFieldCreateRequest: + type: object + properties: + field: + $ref: '#/components/schemas/ItamAssetField' + ItamAssetFieldResponse: + type: object + properties: + field: + $ref: '#/components/schemas/ItamAssetField' + ItamAssetLocation: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the location record was added + readOnly: true + external_id: + type: string + description: An id you can use to connect a location to external data + nullable: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: Display name for the location + updated_at: + type: string + format: date-time + description: The time of the location's last update + readOnly: true + url: + type: string + description: Direct link to the specific location + readOnly: true + required: + - name + ItamAssetLocationCreateRequest: + type: object + properties: + location: + $ref: '#/components/schemas/ItamAssetLocation' + ItamAssetLocationResponse: + type: object + properties: + location: + $ref: '#/components/schemas/ItamAssetLocation' + ItamAssetLocationsResponse: + type: object + allOf: + - type: object + properties: + locations: + type: array + items: + $ref: '#/components/schemas/ItamAssetLocation' + - $ref: '#/components/schemas/CursorPaginationMeta' + ItamAssetResponse: + type: object + properties: + asset: + $ref: '#/components/schemas/ItamAsset' + ItamAssetStatus: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the status record was added + readOnly: true + external_id: + type: string + description: An id you can use to connect a status to external data + nullable: true + readOnly: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: Display name for the status + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the status's last update + readOnly: true + url: + type: string + description: Direct link to the specific status + readOnly: true + ItamAssetStatusResponse: + type: object + properties: + status: + $ref: '#/components/schemas/ItamAssetStatus' + ItamAssetStatusesResponse: + type: object + properties: + statuses: + type: array + items: + $ref: '#/components/schemas/ItamAssetStatus' + ItamAssetType: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the asset type was created + readOnly: true + created_by_user_id: + type: integer + description: The id of the user who created the asset type + readOnly: true + description: + type: string + description: A description of the asset type + nullable: true + external_id: + type: string + description: An id you can use to link asset types to external data + nullable: true + field_keys: + type: array + description: Custom field keys associated with the asset type + items: + type: string + hierarchy_depth: + type: integer + description: 'The depth within the hierarchy tree. Valid values: 1, 2, and 3' + readOnly: true + id: + type: string + description: Automatically assigned upon creation + readOnly: true + is_standard: + type: boolean + description: Whether this asset type is a standard asset type. Standard asset types cannot be modified. + readOnly: true + name: + type: string + description: A unique display name for the asset type + readOnly: true + parent_id: + type: string + description: The id of the parent asset type within the hierarchy tree + updated_at: + type: string + format: date-time + description: The time of the asset type's last update + readOnly: true + updated_by_user_id: + type: integer + description: The id of the user who last the asset type + readOnly: true + url: + type: string + description: Direct link to the specific asset type + readOnly: true + required: + - name + - parent_id + ItamAssetTypeCreateRequest: + type: object + properties: + asset_type: + $ref: '#/components/schemas/ItamAssetType' + ItamAssetTypeFieldsResponse: + type: object + properties: + fields: + type: array + items: + $ref: '#/components/schemas/ItamAssetField' + ItamAssetTypeResponse: + type: object + properties: + asset_type: + $ref: '#/components/schemas/ItamAssetType' + ItamAssetTypesResponse: + type: object + properties: + asset_types: + type: array + items: + $ref: '#/components/schemas/ItamAssetType' + ItamAssetsResponse: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/ItamAsset' + links: + type: object + properties: + next: + type: string + nullable: true + prev: + type: string + nullable: true + required: + - prev + - next + meta: + type: object + properties: + after_cursor: + type: string + nullable: true + before_cursor: + type: string + nullable: true + has_more: + type: boolean + required: + - has_more + - after_cursor + - before_cursor + JobStatusObject: + type: object + properties: + id: + type: string + description: Automatically assigned when the job is queued + readOnly: true + job_type: + type: string + description: The type of the job + readOnly: true + message: + type: string + description: Message from the job worker, if any + nullable: true + readOnly: true + progress: + type: integer + description: Number of tasks that have already been completed + nullable: true + readOnly: true + results: + description: Result data from processed tasks. See [Results](#results) below + oneOf: + - type: array + items: + $ref: '#/components/schemas/JobStatusResultObject' + nullable: true + - type: object + properties: + success: + type: boolean + description: Whether the action was successful or not + readOnly: true + required: + - success + readOnly: true + status: + type: string + description: 'The current status. One of the following: "queued", "working", "failed", "completed"' + readOnly: true + total: + type: integer + description: The total number of tasks this job is batching through + nullable: true + readOnly: true + url: + type: string + description: The URL to poll for status updates + readOnly: true + example: + id: 82de0b044094f0c67893ac9fe64f1a99 + message: Completed at 2018-03-08 10:07:04 +0000 + progress: 2 + results: + - action: update + id: 244 + status: Updated + success: true + - action: update + id: 245 + status: Updated + success: true + status: completed + total: 2 + url: https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99 + JobStatusResponse: + type: object + properties: + job_status: + $ref: '#/components/schemas/JobStatusObject' + JobStatusResultObject: + oneOf: + - $ref: '#/components/schemas/CreateResourceResult' + - $ref: '#/components/schemas/UpdateResourceResult' + - $ref: '#/components/schemas/FailedResult' + additionalProperties: true + JobStatusesResponse: + type: object + properties: + job_statuses: + type: array + items: + $ref: '#/components/schemas/JobStatusObject' + required: + - job_statuses + ListDeletedTicketsResponse: + type: object + allOf: + - type: object + properties: + deleted_tickets: + type: array + items: + type: object + properties: + actor: + type: object + properties: + id: + type: integer + name: + type: string + deleted_at: + type: string + id: + type: integer + previous_state: + type: string + subject: + type: string + - $ref: '#/components/schemas/OffsetPaginationObject' + ListTicketCollaboratorsResponse: + type: object + additionalProperties: true + ListTicketEmailCCsResponse: + type: object + additionalProperties: true + ListTicketFollowersResponse: + type: object + additionalProperties: true + ListTicketIncidentsResponse: + type: object + additionalProperties: true + ListTicketProblemsResponse: + type: object + additionalProperties: true + LocaleObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The ISO 8601 formatted date-time the locale was created + readOnly: true + id: + type: integer + description: The unique ID of the locale + readOnly: true + locale: + type: string + description: The name of the locale + readOnly: true + name: + type: string + description: The name of the language + readOnly: true + updated_at: + type: string + format: date-time + description: The ISO 8601 formatted date-time when the locale was last updated + readOnly: true + url: + type: string + description: The URL of the locale record + readOnly: true + example: + created_at: "2009-07-20T22:55:29Z" + id: 1 + locale: en-US + name: English + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/locales/en-US + LocaleResponse: + type: object + properties: + locale: + $ref: '#/components/schemas/LocaleObject' + LocalesResponse: + type: object + properties: + locales: + type: array + items: + $ref: '#/components/schemas/LocaleObject' + MacroApplyTicketResponse: + type: object + properties: + result: + type: object + properties: + ticket: + type: object + properties: + assignee_id: + type: integer + comment: + type: object + properties: + body: + type: string + public: + type: boolean + scoped_body: + type: array + items: + type: array + items: + type: string + fields: + type: object + properties: + id: + type: integer + value: + type: string + group_id: + type: integer + id: + type: integer + url: + type: string + MacroAttachmentObject: + type: object + properties: + content_type: + type: string + description: 'The content type of the image. Example value: "image/png"' + readOnly: true + content_url: + type: string + description: A full URL where the attachment image file can be downloaded + readOnly: true + created_at: + type: string + format: date-time + description: The time when this attachment was created + filename: + type: string + description: The name of the image file + readOnly: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + size: + type: integer + description: The size of the image file in bytes + readOnly: true + MacroAttachmentResponse: + type: object + properties: + macro_attachment: + $ref: '#/components/schemas/MacroAttachmentObject' + MacroAttachmentsResponse: + type: object + properties: + macro_attachments: + type: array + items: + $ref: '#/components/schemas/MacroAttachmentObject' + MacroCategoriesResponse: + type: object + properties: + categories: + type: array + items: + type: string + MacroCommonObject: + type: object + properties: + actions: + type: array + description: Each action describes what the macro will do. See [Actions reference](/documentation/ticketing/reference-guides/actions-reference) + items: + $ref: '#/components/schemas/ActionObject' + active: + type: boolean + description: Useful for determining if the macro should be displayed + created_at: + type: string + format: date-time + description: The time the macro was created + readOnly: true + default: + type: boolean + description: If true, the macro is a default macro + readOnly: true + description: + type: string + description: The description of the macro + nullable: true + id: + type: integer + description: The id automatically assigned when a macro is created + readOnly: true + position: + type: integer + description: The position of the macro + raw_title: + type: string + description: The raw format of the title of the macro + restriction: + type: object + description: Access to this macro. A null value allows unrestricted access for all users in the account + additionalProperties: true + nullable: true + title: + type: string + description: The title of the macro + updated_at: + type: string + format: date-time + description: The time of the last update of the macro + readOnly: true + url: + type: string + description: A URL to access the macro's details + readOnly: true + example: + actions: + - field: status + value: solved + - field: priority + value: normal + - field: type + value: incident + - field: assignee_id + value: current_user + - field: group_id + value: current_groups + - field: comment_value + value: 'Thanks for your request. This issue you reported is a known issue. For more information, please visit our forums. ' + active: true + created_at: "2019-09-16T02:17:38Z" + default: false + description: null + id: 360111062754 + position: 9999 + raw_title: Close and redirect to topics + restriction: null + title: Close and redirect to topics + updated_at: "2019-09-16T02:17:38Z" + url: https://subdomain.zendesk.com/api/v2/macros/360111062754 + required: + - actions + - title + MacroInput: + type: object + properties: + actions: + type: array + description: Each action describes what the macro will do + items: + $ref: '#/components/schemas/ActionObject' + active: + type: boolean + description: Useful for determining if the macro should be displayed + description: + type: string + description: The description of the macro + nullable: true + restriction: + type: object + description: Who may access this macro. Will be null when everyone in the account can access it + properties: + id: + type: integer + description: The numeric ID of the group or user + ids: + type: array + description: The numeric IDs of the groups + items: + type: integer + type: + type: string + description: Allowed values are Group or User + additionalProperties: true + nullable: true + title: + type: string + description: The title of the macro + required: + - title + - actions + MacroObject: + type: object + allOf: + - $ref: '#/components/schemas/MacroCommonObject' + - type: object + properties: + app_installation: + type: string + description: The app installation that requires each macro, if present + nullable: true + categories: + type: string + description: The macro categories + nullable: true + permissions: + type: string + description: Permissions for each macro + nullable: true + usage_1h: + type: integer + description: The number of times each macro has been used in the past hour + usage_7d: + type: integer + description: The number of times each macro has been used in the past week + usage_24h: + type: integer + description: The number of times each macro has been used in the past day + usage_30d: + type: integer + description: The number of times each macro has been used in the past thirty days + example: + actions: [ ] + active: true + description: Sets the ticket status to `solved` + id: 25 + position: 42 + restriction: + id: 4 + type: User + title: Close and Save + MacroResponse: + type: object + properties: + macro: + $ref: '#/components/schemas/MacroObject' + MacroUpdateManyInput: + type: object + properties: + macros: + type: array + items: + type: object + properties: + active: + type: boolean + description: The active status of the macro (true or false) + id: + type: integer + description: The ID of the macro to update + position: + type: integer + description: The new position of the macro + required: + - id + MacrosResponse: + type: object + allOf: + - type: object + properties: + macros: + type: array + items: + $ref: '#/components/schemas/MacroObject' + - $ref: '#/components/schemas/OffsetPaginationObject' + ManySkillBasedRoutingAttributeValues: + type: object + properties: + agent_id: + type: integer + description: Id of the associated agent + readOnly: true + agent_skill_priority: + type: string + description: The priority of the agent skill for this attribute value + enum: + - NORMAL + - HIGH + readOnly: true + attribute_id: + type: string + description: Id of the associated attribute + readOnly: true + attribute_value_id: + type: string + description: Id of the associated attribute value + readOnly: true + created_at: + type: string + format: date-time + description: The time of creation of the instance value + readOnly: true + id: + type: string + description: Automatically assigned when an instance value is created + readOnly: true + name: + type: string + description: Name of the associated attribute value + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the instance value + readOnly: true + url: + type: string + description: The URL of the associated attribute value + readOnly: true + ManySkillBasedRoutingAttributeValuesResponse: + type: object + properties: + count: + type: integer + format: int32 + description: The number of instance values returned + readOnly: true + instance_values: + type: array + items: + $ref: '#/components/schemas/ManySkillBasedRoutingAttributeValues' + next_page: + type: string + description: The URL for the next page of results + nullable: true + readOnly: true + previous_page: + type: string + description: The URL for the previous page of results + nullable: true + readOnly: true + OAuthClientObject: + type: object + properties: + company: + type: string + description: The company name displayed when users are asked to grant access to your application. + created_at: + type: string + format: date-time + description: The time the client was created + readOnly: true + description: + type: string + description: A short description of your client that is displayed to users when they are considering approving access to your application + global: + type: boolean + description: Whether this client is globally accessible. See [Set up a global OAuth client](/documentation/apps/publish-your-app-or-theme/global_oauth_intro/) + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + identifier: + type: string + description: The unique identifier for this client + kind: + type: string + description: Either "public" or "confidential". Specifies whether the OAuth client operates in a public environment where credentials cannot be securely stored, or on secure servers that can safely store credentials. See [Client types](/documentation/ticketing/working-with-oauth/oauth-pkce/#client-types) + logo_url: + type: string + description: The API logo url of this record + readOnly: true + name: + type: string + description: The name of this client + redirect_uri: + type: array + description: An array of the valid redirect URIs for this client + items: + type: string + secret: + type: string + description: The client secret. Generated automatically on creation and returned in full only at that time + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the client + readOnly: true + url: + type: string + description: The API url of this record + readOnly: true + user_id: + type: integer + description: The id of the admin who created the client + example: + company: Zendesk + created_at: "2009-05-13T00:07:08Z" + description: Zendesk Test Client + id: 1 + identifier: test_client + name: My Test Client + redirect_uri: + - https://example.com/callback + secret: af3t24tfj34h43s... + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/clients/1 + user_id: 29 + required: + - name + - identifier + - user_id + OAuthClientsResponse: + type: object + properties: + clients: + type: array + items: + $ref: '#/components/schemas/OAuthClientObject' + OAuthTokenForGrantTypesObject: + title: OAuth Tokens for Grant Types + type: object + properties: + access_token: + type: string + description: The access token + readOnly: true + expires_in: + type: integer + description: Number of seconds the access token is valid. Must be more than 300 seconds (5 minutes) and less than 172,800 seconds (2 days), or less than `refresh_token_expires_in`, whichever is the smallest. Defaults to null + refresh_token: + type: string + description: The refresh token + readOnly: true + refresh_token_expires_in: + type: integer + description: Number of seconds the refresh token is valid. Must be more than 604,800 seconds (7 days) or `expires_in` (if given), and less than 7,776,000 seconds (90 days). Defaults to 2,592,000 seconds (30 days) + scope: + type: string + description: The valid scopes for this token. See [Scope](#scope) below + readOnly: true + token_type: + type: string + description: Type of the access token, for example "bearer" + readOnly: true + example: + access_token: gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo + expires_in: 86400 + refresh_token: af3t24tfj34h43s... + refresh_token_expires_in: 604800 + scope: read + token_type: bearer + OAuthTokenResponse: + type: object + properties: + token: + $ref: '#/components/schemas/OauthTokenObject' + OAuthTokensResponse: + type: object + properties: + tokens: + type: array + items: + $ref: '#/components/schemas/OauthTokenObject' + OauthClientResponse: + type: object + properties: + client: + $ref: '#/components/schemas/OAuthClientObject' + OauthTokenObject: + type: object + properties: + client_id: + type: integer + description: The id of the client this token belongs to + readOnly: true + created_at: + type: string + format: date-time + description: The time the token was created + readOnly: true + expires_at: + type: string + format: date-time + description: The time the token will expire + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + refresh_token: + type: string + description: The refresh token, if generated + readOnly: true + refresh_token_expires_at: + type: string + format: date-time + description: The time the refresh token will expire + readOnly: true + scopes: + type: array + description: An array of the valid scopes for this token. See [Scopes](#scopes) below + items: + type: string + readOnly: true + token: + type: string + description: The access token + readOnly: true + url: + type: string + description: The API url of this record + readOnly: true + used_at: + type: string + format: date-time + description: The latest time this token was used for authentication + readOnly: true + user_id: + type: integer + description: The id of the user this token authenticates as + readOnly: true + example: + client_id: 41 + created_at: "2009-05-13T00:07:08Z" + expires_at: "2011-07-22T00:11:12Z" + id: 1 + refresh_token: af3t24tfj34h43s... + refresh_token_expires_at: "2011-07-22T00:11:12Z" + scopes: + - read + token: af3t24tfj34h43s... + url: https://example.zendesk.com/api/v2/tokens/1 + used_at: "2010-01-22T00:11:12Z" + user_id: 29 + ObjectTriggerActionDefinitionObject: + type: object + properties: + group: + type: string + nullable: + type: boolean + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + format: + type: string + title: + type: string + value: + type: string + ObjectTriggerBulkUpdateItem: + type: object + properties: + active: + type: boolean + description: Whether an object trigger is active + id: + type: integer + description: The id of the object trigger to update + position: + type: integer + description: The new position of the object trigger + example: + active: true + id: 25 + position: 8 + required: + - id + ObjectTriggerBulkUpdateRequest: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/ObjectTriggerBulkUpdateItem' + ObjectTriggerConditionDefinitionObjectAll: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + format: + type: string + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + ObjectTriggerConditionDefinitionObjectAny: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + format: + type: string + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + ObjectTriggerDefinitionObject: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/ObjectTriggerActionDefinitionObject' + conditions_all: + type: array + items: + $ref: '#/components/schemas/ObjectTriggerConditionDefinitionObjectAll' + conditions_any: + type: array + items: + $ref: '#/components/schemas/ObjectTriggerConditionDefinitionObjectAny' + ObjectTriggerDefinitionResponse: + type: object + properties: + definitions: + $ref: '#/components/schemas/ObjectTriggerDefinitionObject' + ObjectTriggerObject: + type: object + properties: + actions: + type: array + description: An array of actions the trigger does when its conditions are met. See [Actions reference](/documentation/ticketing/reference-guides/actions-reference) + items: + $ref: '#/components/schemas/TriggerActionObject' + active: + type: boolean + description: Whether the trigger is active + conditions: + $ref: '#/components/schemas/TriggerConditionsObject' + created_at: + type: string + description: The time the trigger was created + readOnly: true + default: + type: boolean + description: Always false for object triggers + readOnly: true + description: + type: string + description: The description of the trigger + id: + type: integer + description: Automatically assigned when created + readOnly: true + position: + type: integer + description: Position of the trigger, determines the order they will execute in + raw_title: + type: string + description: The raw format of the title of the trigger + title: + type: string + description: The title of the trigger + updated_at: + type: string + description: The time of the last update of the trigger + readOnly: true + url: + type: string + description: The url of the trigger + readOnly: true + example: + actions: + - { } + active: true + conditions: { } + created_at: "2024-07-08T20:44:32Z" + default: false + description: Sets mile count when heat not present on order custom object + id: 25 + position: 8 + raw_title: CO trigger with tagger field condition + title: CO trigger with tagger field condition + updated_at: "2024-07-08T20:44:32Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/25 + required: + - conditions + - actions + - title + ObjectTriggerRequest: + type: object + properties: + trigger: + allOf: + - $ref: '#/components/schemas/ObjectTriggerObject' + ObjectTriggerResponse: + type: object + properties: + trigger: + $ref: '#/components/schemas/ObjectTriggerObject' + ObjectTriggersResponse: + type: object + properties: + count: + type: integer + next_page: + type: string + nullable: true + previous_page: + type: string + nullable: true + triggers: + type: array + items: + $ref: '#/components/schemas/ObjectTriggerObject' + OffsetPaginationObject: + type: object + properties: + count: + type: integer + description: the total record count + next_page: + type: string + format: uri + description: the URL of the next page + nullable: true + previous_page: + type: string + format: uri + description: the URL of the previous page + nullable: true + OrganizationFieldObject: + type: object + allOf: + - $ref: '#/components/schemas/CustomFieldObject' + - type: object + properties: + relationship_target_type: + type: string + description: A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", and "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment". + example: + active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/organization_fields/7 + OrganizationFieldResponse: + type: object + properties: + organization_field: + $ref: '#/components/schemas/OrganizationFieldObject' + OrganizationFieldsResponse: + type: object + properties: + count: + type: integer + description: Total count of records retrieved + readOnly: true + next_page: + type: string + description: URL of the next page + nullable: true + readOnly: true + organization_fields: + type: array + items: + $ref: '#/components/schemas/OrganizationFieldObject' + previous_page: + type: string + description: URL of the previous page + nullable: true + readOnly: true + OrganizationMembershipObject: + type: object + properties: + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + default: + type: boolean + description: Denotes whether this is the default organization membership for the user. If false, returns `null` + nullable: true + id: + type: integer + description: Automatically assigned when the membership is created + readOnly: true + organization_id: + type: integer + description: The ID of the organization associated with this user, in this membership + readOnly: true + organization_name: + type: string + description: The name of the organization associated with this user, in this membership + readOnly: true + updated_at: + type: string + format: date-time + description: When this record last got updated + readOnly: true + url: + type: string + description: The API url of this membership + readOnly: true + user_id: + type: integer + description: The ID of the user for whom this membership belongs + readOnly: true + view_tickets: + type: boolean + description: Denotes whether the user can or cannot have access to all organization's tickets. + readOnly: true + example: + created_at: "2009-05-13T00:07:08Z" + default: true + id: 4 + organization_id: 12 + organization_name: first organization + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/organization_memberships/4 + user_id: 29 + view_tickets: true + required: + - user_id + - organization_id + - default + OrganizationMembershipResponse: + type: object + properties: + organization_membership: + $ref: '#/components/schemas/OrganizationMembershipObject' + OrganizationMembershipsResponse: + type: object + properties: + organization_memberships: + type: array + items: + $ref: '#/components/schemas/OrganizationMembershipObject' + OrganizationMergeListResponse: + type: object + properties: + organization_merges: + type: array + items: + type: object + properties: + id: + type: string + format: string + loser_id: + type: integer + status: + type: string + enum: + - new + - in_progress + - error + - complete + url: + type: string + format: string + winner_id: + type: integer + required: + - id + - url + - loser_id + - winner_id + - status + OrganizationMergeRequest: + type: object + properties: + organization_merge: + type: object + properties: + winner_id: + type: integer + description: The id of the winning organization. + required: + - winner_id + OrganizationMergeResponse: + type: object + properties: + organization_merge: + type: object + properties: + id: + type: string + format: string + loser_id: + type: integer + status: + type: string + enum: + - new + - in_progress + - error + - complete + url: + type: string + format: string + winner_id: + type: integer + required: + - id + - url + - loser_id + - winner_id + - status + OrganizationMetadataObject: + type: object + properties: + tickets_count: + type: integer + description: The number of tickets for the organization + users_count: + type: integer + description: The number of users for the organization + OrganizationObject: + type: object + properties: + created_at: + type: string + description: The time the organization was created + readOnly: true + details: + type: string + description: Any details obout the organization, such as the address + nullable: true + domain_names: + type: array + description: An array of domain names associated with this organization + items: + type: string + external_id: + type: string + description: A unique external id to associate organizations to an external record. The id is case-insensitive. For example, "company1" and "Company1" are considered the same + nullable: true + group_id: + type: integer + description: New tickets from users in this organization are automatically put in this group + nullable: true + id: + type: integer + description: Automatically assigned when the organization is created + name: + type: string + description: A unique name for the organization + notes: + type: string + description: Any notes you have about the organization + nullable: true + organization_fields: + type: object + description: Custom fields for this organization. See [Custom organization fields](/api-reference/ticketing/organizations/organizations/#custom-organization-fields) + additionalProperties: + oneOf: + - type: string + - type: number + nullable: true + shared_comments: + type: boolean + description: End users in this organization are able to comment on each other's tickets + shared_tickets: + type: boolean + description: End users in this organization are able to see each other's tickets + tags: + type: array + description: The tags of the organization + items: + type: string + updated_at: + type: string + description: The time of the last update of the organization + readOnly: true + url: + type: string + description: The API url of this organization + readOnly: true + example: + created_at: "2009-07-20T22:55:29Z" + details: This is a kind of organization + domain_names: + - example.com + - test.com + external_id: ABC123 + group_id: null + id: 35436 + name: One Organization + notes: "" + organization_fields: + org_decimal: 5.2 + org_dropdown: option_1 + shared_comments: true + shared_tickets: true + tags: + - enterprise + - other_tag + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/organizations/35436 + required: + - name + OrganizationResponse: + type: object + properties: + organization: + $ref: '#/components/schemas/OrganizationObject' + OrganizationSubscriptionCreateRequest: + type: object + properties: + organization_subscription: + $ref: '#/components/schemas/OrganizationSubscriptionInput' + OrganizationSubscriptionInput: + type: object + properties: + organization_id: + type: integer + description: The ID of the organization + user_id: + type: integer + description: The ID of the user + OrganizationSubscriptionObject: + title: Organization Subscriptions + type: object + properties: + created_at: + type: string + format: date-time + description: The date the organization subscription was created + id: + type: integer + description: The ID of the organization subscription + organization_id: + type: integer + description: The ID of the organization + user_id: + type: integer + description: The ID of the user + example: + created_at: "2009-07-20T22:55:29Z" + id: 1234 + organization_id: 32 + user_id: 482 + OrganizationSubscriptionResponse: + type: object + properties: + organization_subscription: + $ref: '#/components/schemas/OrganizationSubscriptionObject' + OrganizationSubscriptionsResponse: + type: object + allOf: + - $ref: '#/components/schemas/OffsetPaginationObject' + - type: object + properties: + organization_subscriptions: + type: array + description: An array of organization subscriptions + items: + $ref: '#/components/schemas/OrganizationSubscriptionObject' + OrganizationsRelatedResponse: + type: object + properties: + organization_related: + $ref: '#/components/schemas/OrganizationMetadataObject' + OrganizationsResponse: + type: object + properties: + count: + type: integer + next_page: + type: string + nullable: true + organizations: + type: array + items: + $ref: '#/components/schemas/OrganizationObject' + previous_page: + type: string + nullable: true + OtpSettingResponse: + type: object + properties: + one_time_password: + type: object + properties: + configured: + type: boolean + enforced: + type: boolean + phone: + type: string + tfa_configured: + type: boolean + time_based: + type: boolean + url: + type: string + example: + one_time_password: + configured: true + enforced: true + phone: "+18917389123" + tfa_configured: true + time_based: true + url: https://example.zendesk.com/auth/api/one_time_password + Pagination: + type: object + properties: + links: + type: object + properties: + next: + type: string + prev: + type: string + meta: + type: object + properties: + after_cursor: + type: string + before_cursor: + type: string + has_more: + type: boolean + PermissionAction: + type: object + properties: + allowed: + type: boolean + description: Whether this action is allowed for the role + example: true + rule_id: + type: integer + description: Optional access rule ID that further restricts this permission. Use null when no rule applies. + example: 6862342718335 + nullable: true + PermissionPoliciesResponse: + type: object + properties: + policies: + type: array + items: + $ref: '#/components/schemas/PermissionPolicy' + PermissionPolicy: + type: object + properties: + id: + type: string + description: The policy ID (e.g., 'custom-role-123' or 'end-user') + example: custom-role-6678128886399 + records: + type: object + description: Permission settings for different record operations + properties: + create: + $ref: '#/components/schemas/PermissionAction' + delete: + $ref: '#/components/schemas/PermissionAction' + read: + $ref: '#/components/schemas/PermissionAction' + update: + $ref: '#/components/schemas/PermissionAction' + role_name: + type: string + description: The name of the role this policy applies to + example: Custom Role + PermissionPolicyResponse: + type: object + properties: + policy: + $ref: '#/components/schemas/PermissionPolicy' + PermissionPolicyUpdateRequest: + type: object + properties: + policy: + type: object + properties: + records: + type: object + description: Permission settings for different record operations + properties: + create: + $ref: '#/components/schemas/PermissionAction' + delete: + $ref: '#/components/schemas/PermissionAction' + read: + $ref: '#/components/schemas/PermissionAction' + update: + $ref: '#/components/schemas/PermissionAction' + PushNotificationDevicesInput: + type: array + items: + type: string + description: Mobile device token + PushNotificationDevicesRequest: + type: object + properties: + push_notification_devices: + $ref: '#/components/schemas/PushNotificationDevicesInput' + QueueObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the queue was created + readOnly: true + definition: + type: object + description: Conditions when queue could be applied + properties: + all: + type: array + items: + type: object + properties: + field: + type: string + operator: + type: string + value: + type: string + any: + type: array + items: + type: object + properties: + field: + type: string + operator: + type: string + value: + type: string + description: + type: string + description: The description of the queue + id: + type: string + description: Automatically assigned when creating queue + readOnly: true + name: + type: string + description: The name of the queue + order: + type: integer + description: The queue-applied order + primary_groups: + type: object + description: Primary group ids linked to the queue + properties: + count: + type: integer + groups: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string + priority: + type: integer + description: The queue-applied priority + secondary_groups: + type: object + description: Secondary group ids linked to the queue + properties: + count: + type: integer + groups: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string + updated_at: + type: string + format: date-time + description: The time of the queue's last update + readOnly: true + url: + type: string + description: The API URL of the queue + readOnly: true + example: + created_at: "2023-11-27T09:03:59Z" + definition: + all: + - field: priority + operator: is + value: urgent + any: [ ] + description: Queue description + id: 01HG80ATNNZK1N7XRFVKX48XD6 + name: New queue with valid definition + order: 1 + primary_groups: + count: 2 + groups: + - id: 6784729637757 + name: EWR + - id: 5399674286077 + name: test + priority: 1 + secondary_groups: + count: 0 + groups: [ ] + updated_at: "2023-11-27T09:03:59Z" + url: https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6 + QueueResponse: + type: object + properties: + queue: + $ref: '#/components/schemas/QueueObject' + QueuesResponse: + type: object + properties: + queues: + type: array + items: + $ref: '#/components/schemas/QueueObject' + RecipientObject: + type: object + properties: + delivery_status: + type: object + description: Details about the delivery status + properties: + code: + type: string + description: The delivery status code (SMTP code and DSN code) + readOnly: true + id: + type: integer + description: The delivery status id + readOnly: true + message: + type: string + description: The delivery status description + readOnly: true + name: + type: string + description: The delivery status type (key) + readOnly: true + email_address: + type: string + description: The recipient's email address + readOnly: true + user_id: + type: integer + description: The recipient's user id + readOnly: true + RecoverSuspendedTicketResponse: + type: object + properties: + ticket: + type: array + items: + $ref: '#/components/schemas/TicketObject' + RecoverSuspendedTicketUnprocessableContentResponse: + type: object + properties: + ticket: + type: array + items: + $ref: '#/components/schemas/SuspendedTicketObject' + RecoverSuspendedTicketsResponse: + type: object + properties: + tickets: + type: array + items: + $ref: '#/components/schemas/TicketObject' + RelationshipFilterDefinition: + type: object + properties: + conditions_all: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDefinitionObjectAll' + conditions_any: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDefinitionObjectAny' + RelationshipFilterDefinitionResponse: + type: object + properties: + definitions: + $ref: '#/components/schemas/RelationshipFilterDefinition' + RemoteAuthenticationObject: + type: object + properties: + agent: + type: boolean + description: If true, the method is used for the team member remote authentication + agent_primary: + type: boolean + description: If team members for sign-in are redirected to a remote authentication, this is the default method shown to a team member + auth_flow: + type: string + description: Authentication mode + enum: + - PKCE + - authorization_code + auth_mode: + type: integer + description: The numeric representation of remote authentication type + enum: + - 2 + - 3 + - 4 + auth_mode_name: + type: string + description: The string representation of remote authentication type + enum: + - saml + - jwt + - oidc + readOnly: true + auth_url: + type: string + description: | + For the "oidc" auth mode only. + The authorization endpoint to use for the request + auto_discovery: + type: boolean + description: | + For the "oidc" auth mode only. + When turned on, Zendesk will automatically extract the configuration details from the OIDC Configuration Document. + Only the Issuer URL and Authentication Mode need to be provided + can_display_button_to_end_users: + type: boolean + description: If users can choose how they sign in, this remote authentication method appears as an option when it's active + can_display_button_to_team_members: + type: boolean + description: If team members can choose how they sign in, this remote authentication method appears as an option when it's active + client_id: + type: string + description: | + For the "oidc" auth mode only. + end_user: + type: boolean + description: If true, the method is used for the end-user remote authentication + end_user_primary: + type: boolean + description: If end users for sign-in are redirected to a remote authentication, this is the default method shown to an end user + fingerprint: + type: string + description: | + For the "saml" auth mode only. + The SHA-256 certificate fingerprint. + id: + type: integer + description: Uniquely identifies a remote authentication. Automatically assigned on creation + readOnly: true + ip_ranges: + type: string + description: | + Requests from these IP ranges will always be routed via remote authentication. Requests from IP addresses outside these ranges will be routed to the normal sign-in form. + When this is blank, all requests are routed through remote authentication. + An IP range is in the format n.n.n.n, where n is a number or an asterisk (*) wild card. + Multiple IP ranges are separated with spaces + nullable: true + is_active: + type: boolean + description: If true, the method is enabled for end users or team members + readOnly: true + issuer_url: + type: string + description: | + For the "oidc" auth mode only. + This is the URL that is used as the logical identifier for your provider's connection + jwks_url: + type: string + description: | + For the "oidc" auth mode only. + This is the URL that returns the provider's JSON Web Key Set + label: + type: string + description: The sign-in button label + masked_client_secret: + type: string + description: | + For the "oidc" auth mode only. + masked_secret: + type: string + description: | + For the "jwt" auth mode only. + The token is a shared secret between you and Zendesk. It must never be publicized + name: + type: string + description: The name of the remote configuration. It's good to use something recognizable like the identity provider's name + priority: + type: integer + remote_login_url: + type: string + description: | + The URL that Zendesk invokes to redirect users to the identity provider + remote_logout_url: + type: string + description: | + The URL that Zendesk uses to redirect users after they sign out + scope: + type: string + description: | + For the "oidc" auth mode only. + These are the user details your account can access, like name and email address. + Supported scopes within the OIDC standard include `openid`, `profile`, `email`, `address`, and `phone`. + It must contain at least `openid` and `email`. + Scopes are separated with spaces + token_url: + type: string + description: | + For the "oidc" auth mode only. + Your account uses this URL to request access tokens for users + update_external_ids: + type: boolean + description: | + For the "jwt" auth mode only. + When enabled, the external id of the user being signed in can be updated. + This only happens when a user with the external id is not found, but the user's email address is found. + The external id is unique for an account. + Users without an external id will have one added if it is present in the authentication request + user_info_url: + type: string + description: | + For the "oidc" auth mode only. + This the URL that returns Claims about the authenticated user + example: + agent: false + agent_primary: false + auth_mode: 3 + auth_mode_name: jwt + can_display_button_to_end_users: false + can_display_button_to_team_members: false + end_user: true + end_user_primary: false + id: 7949169175677 + ip_ranges: null + is_active: true + label: "" + masked_secret: SRT2hj****************************************** + name: Testing JWT + priority: 1 + remote_login_url: https://example.com/sso/login + remote_logout_url: https://example.zendesk.com/sso/logout + update_external_ids: false + required: + - name + - auth_mode + - remote_login_url + - remote_logout_url + - end_user + - end_user_primary + - agent + - agent_primary + - can_display_button_to_team_members + - can_display_button_to_end_users + RemoteAuthenticationsResponse: + type: object + properties: + remote_authentications: + type: array + items: + $ref: '#/components/schemas/RemoteAuthenticationObject' + RenewSessionResponse: + type: object + properties: + authenticity_token: + type: string + description: A token of authenticity for the request + RequestObject: + type: object + properties: + assignee_id: + type: integer + description: The id of the assignee if the field is visible to end users + readOnly: true + can_be_solved_by_me: + type: boolean + description: If true, an end user can mark the request as solved. See [Update Request](/api-reference/ticketing/tickets/ticket-requests/#update-request) + readOnly: true + collaborator_ids: + type: array + description: The ids of users currently CC'ed on the ticket + items: + type: integer + readOnly: true + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + custom_fields: + type: array + description: Custom fields for the request. See [Setting custom field values](/api-reference/ticketing/tickets/tickets/#setting-custom-field-values) in the Tickets doc + items: + type: object + properties: + id: + type: integer + value: + type: string + custom_status_id: + type: integer + description: The custom ticket status id of the ticket + description: + type: string + description: Read-only first comment on the request. When [creating a request](#create-request), use `comment` to set the description + readOnly: true + due_at: + type: string + format: date-time + description: When the task is due (only applies if the request is of type "task") + email_cc_ids: + type: array + description: The ids of users who are currently email CCs on the ticket. See [CCs and followers resources](https://support.zendesk.com/hc/en-us/articles/360020585233) in the Support Help Center + items: + type: integer + readOnly: true + followup_source_id: + type: integer + description: The id of the original ticket if this request is a follow-up ticket. See [Create Request](#create-request) + readOnly: true + group_id: + type: integer + description: The id of the assigned group if the field is visible to end users + readOnly: true + id: + type: integer + description: Automatically assigned when creating requests + readOnly: true + is_public: + type: boolean + description: Is true if any comments are public, false otherwise + readOnly: true + organization_id: + type: integer + description: The organization of the requester + readOnly: true + priority: + type: string + description: The priority of the request, "low", "normal", "high", "urgent" + recipient: + type: string + description: The original recipient e-mail address of the request + requester_id: + type: integer + description: The id of the requester + readOnly: true + solved: + type: boolean + description: Whether or not request is solved (an end user can set this if "can_be_solved_by_me", above, is true for that user) + status: + type: string + description: The state of the request, "new", "open", "pending", "hold", "solved", "closed" + subject: + type: string + description: The value of the subject field for this request if the subject field is visible to end users; a truncated version of the description otherwise + ticket_form_id: + type: integer + description: The numeric id of the ticket form associated with this request if the form is visible to end users - only applicable for enterprise accounts + type: + type: string + description: The type of the request, "question", "incident", "problem", "task" + updated_at: + type: string + format: date-time + description: When this record last got updated + readOnly: true + url: + type: string + description: The API url of this request + readOnly: true + via: + $ref: '#/components/schemas/TicketAuditViaObject' + example: + assignee_id: 72983 + can_be_solved_by_me: false + collaborator_ids: [ ] + created_at: "2009-07-20T22:55:29Z" + description: The fire is very colorful. + due_at: "2011-05-24T12:00:00Z" + group_id: 8665 + id: 35436 + organization_id: 509974 + priority: normal + requester_id: 1462 + status: open + subject: Help, my printer is on fire! + ticket_form_id: 2 + type: problem + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/requests/35436 + via: + channel: web + required: + - subject + RequestResponse: + type: object + properties: + request: + $ref: '#/components/schemas/RequestObject' + RequestsResponse: + type: object + properties: + requests: + type: array + items: + $ref: '#/components/schemas/RequestObject' + ResourceCollectionObject: + type: object + properties: + created_at: + type: string + format: date-time + description: When the resource collection was created + readOnly: true + id: + type: integer + description: id for the resource collection. Automatically assigned upon creation + readOnly: true + resources: + type: array + description: Array of resource metadata objects. See [Resource objects](#resource-objects) + items: + type: object + properties: + deleted: + type: boolean + identifier: + type: string + resource_id: + type: integer + type: + type: string + readOnly: true + updated_at: + type: string + format: date-time + description: Last time the resource collection was updated + readOnly: true + example: + created_at: "2011-07-20T22:55:29Z" + id: 35436 + resources: + - deleted: false + identifier: email_on_ticket_solved + resource_id: 10824486485524 + type: triggers + - deleted: false + identifier: support_description + resource_id: 10824486482580 + type: ticket_fields + updated_at: "2011-07-20T22:55:29Z" + ResourceCollectionResponse: + type: object + properties: + resource_collection: + $ref: '#/components/schemas/ResourceCollectionObject' + ResourceCollectionsResponse: + type: object + properties: + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + resource_collections: + type: array + items: + $ref: '#/components/schemas/ResourceCollectionObject' + ReverseLookupResponse: + type: object + anyOf: + - $ref: '#/components/schemas/UsersResponse' + RoleAuthenticationObject: + type: object + properties: + enforce_sso: + type: boolean + google_login: + type: boolean + office_365_login: + type: boolean + primary_external_auth: + type: string + nullable: true + remote_login: + type: boolean + security_policy_id: + type: integer + security_policy_name: + type: string + enum: + - low + - medium + - high + - recommended + - custom + sso_auto_redirect: + type: boolean + two_factor_enforce: + type: boolean + zendesk_login: + type: boolean + SLAPoliciesResponse: + type: object + properties: + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + sla_policies: + type: array + items: + $ref: '#/components/schemas/SLAPolicyObject' + SLAPolicyFilterConditionObject: + type: object + properties: + field: + type: string + description: The name of a ticket field + operator: + type: string + description: A comparison operator + value: + description: The value of a ticket field + oneOf: + - type: string + - type: array + items: + oneOf: + - type: string + - type: integer + SLAPolicyFilterDefinitionResponse: + type: object + properties: + definitions: + type: object + properties: + all: + type: array + items: + type: object + properties: + group: + type: string + operators: + type: array + items: + type: object + properties: + title: + type: string + value: + type: string + target: + type: string + nullable: true + title: + type: string + value: + type: string + values: + type: object + properties: + list: + type: array + items: + type: object + properties: + title: + type: string + value: + type: string + nullable: true + type: + type: string + any: + type: array + items: + type: object + properties: + group: + type: string + operators: + type: array + items: + type: object + properties: + title: + type: string + value: + type: string + target: + type: string + nullable: true + title: + type: string + value: + type: string + values: + type: object + properties: + list: + type: array + items: + type: object + properties: + title: + type: string + value: + type: string + nullable: true + type: + type: string + SLAPolicyFilterObject: + type: object + description: An object that describes the conditions that a ticket must match in order for an SLA policy to be applied to that ticket. See [Filter](#filter). + properties: + all: + type: array + items: + $ref: '#/components/schemas/SLAPolicyFilterConditionObject' + any: + type: array + items: + $ref: '#/components/schemas/SLAPolicyFilterConditionObject' + SLAPolicyMetricObject: + type: object + properties: + business_hours: + type: boolean + description: Whether the metric targets are being measured in business hours or calendar hours + metric: + type: string + description: The definition of the time that is being measured + priority: + type: string + description: Priority that a ticket must match + target: + type: integer + description: The time within which the end-state for a metric should be met + SLAPolicyObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the SLA policy was created + readOnly: true + description: + type: string + description: The description of the SLA policy + filter: + $ref: '#/components/schemas/SLAPolicyFilterObject' + id: + type: integer + description: Automatically assigned when created + readOnly: true + policy_metrics: + type: array + description: Array of [Policy Metric](#policy-metric) objects + items: + $ref: '#/components/schemas/SLAPolicyMetricObject' + position: + type: integer + description: Position of the SLA policy that determines the order they will be matched. If not specified, the SLA policy is added as the last position + title: + type: string + description: The title of the SLA policy + updated_at: + type: string + format: date-time + description: The time of the last update of the SLA policy + readOnly: true + url: + type: string + description: URL of the SLA policy record + readOnly: true + example: + created_at: "2015-03-17T22:50:26Z" + description: 'Organizations: Silver Plan' + filter: + all: + - field: type + operator: is + value: incident + - field: via_id + operator: is + value: "4" + - field: custom_status_id + operator: includes + value: + - "1" + - "2" + any: [ ] + id: 25 + policy_metrics: + - business_hours: false + metric: first_reply_time + priority: low + target: 60 + position: 3 + title: Silver Plan + updated_at: "2015-03-17T22:50:26Z" + url: https://company.zendesk.com/api/v2/slas/policies/25 + required: + - title + - filter + SLAPolicyResponse: + type: object + properties: + sla_policy: + $ref: '#/components/schemas/SLAPolicyObject' + SatisfactionRatingObject: + type: object + properties: + assignee_id: + type: integer + description: The id of agent assigned to at the time of rating + readOnly: true + comment: + type: string + description: The comment received with this rating, if available + created_at: + type: string + format: date-time + description: The time the satisfaction rating got created + readOnly: true + group_id: + type: integer + description: The id of group assigned to at the time of rating + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + reason: + type: string + description: The reason for a bad rating given by the requester in a follow-up question. Satisfaction reasons must be [enabled](https://support.zendesk.com/hc/en-us/articles/223152967) + reason_code: + type: integer + description: The default reasons the user can select from a list menu for giving a negative rating. See [Reason codes](/api-reference/ticketing/ticket-management/satisfaction_reasons/#reason-codes) in the Satisfaction Reasons API. Can only be set on ratings with a `score` of "bad". Responses don't include this property + reason_id: + type: integer + description: id for the reason the user gave a negative rating. Can only be set on ratings with a `score` of "bad". To get a descriptive value for the id, use the [Show Reason for Satisfaction Rating](/api-reference/ticketing/ticket-management/satisfaction_reasons/#show-reason-for-satisfaction-rating) endpoint + requester_id: + type: integer + description: The id of ticket requester submitting the rating + readOnly: true + score: + type: string + description: The rating "offered", "unoffered", "good" or "bad". For POST requests, only "good" or "bad" are valid + ticket_id: + type: integer + description: The id of ticket being rated + readOnly: true + updated_at: + type: string + format: date-time + description: The time the satisfaction rating got updated + readOnly: true + url: + type: string + description: The API url of this rating + readOnly: true + example: + assignee_id: 135 + created_at: "2011-07-20T22:55:29Z" + group_id: 44 + id: 35436 + requester_id: 7881 + score: good + ticket_id: 208 + updated_at: "2011-07-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/satisfaction_ratings/62 + required: + - assignee_id + - group_id + - requester_id + - ticket_id + - score + SatisfactionRatingResponse: + type: object + properties: + satisfaction_rating: + type: array + items: + $ref: '#/components/schemas/SatisfactionRatingObject' + SatisfactionRatingsCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + SatisfactionRatingsResponse: + type: object + properties: + satisfaction_ratings: + type: array + items: + $ref: '#/components/schemas/SatisfactionRatingObject' + SatisfactionReasonObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the reason was created + readOnly: true + deleted_at: + type: string + format: date-time + description: The time the reason was deleted + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + raw_value: + type: string + description: The dynamic content placeholder, if present, or the current "value", if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + reason_code: + type: integer + description: An account-level code for referencing the reason. Custom reasons are assigned an auto-incrementing integer (non-system reason codes begin at 1000). See [Reason codes](#reason-codes) + readOnly: true + updated_at: + type: string + format: date-time + description: The time the reason was updated + readOnly: true + url: + type: string + description: API URL for the resource + readOnly: true + value: + type: string + description: Translated value of the reason in the account locale + example: + created_at: "2011-07-20T22:55:29Z" + deleted_at: "2012-03-12T12:45:32Z" + id: 35436 + raw_value: '{{dc.reason_code_1003}}' + reason_code: 1003 + updated_at: "2011-07-20T22:55:29Z" + url: https://example.zendesk.com/api/v2/satisfaction_reasons/35436 + value: Agent did not respond quickly + required: + - value + SatisfactionReasonResponse: + type: object + properties: + reason: + type: array + items: + $ref: '#/components/schemas/SatisfactionReasonObject' + SatisfactionReasonsResponse: + type: object + properties: + reasons: + type: array + items: + $ref: '#/components/schemas/SatisfactionReasonObject' + SearchCountResponse: + type: object + properties: + count: + type: integer + SearchExportResponse: + type: object + properties: + facets: + type: string + description: The facets corresponding to the search query + nullable: true + readOnly: true + links: + type: object + description: The links to the previous and next entries via the cursor ids in the metadata. + properties: + next: + type: string + description: The url to the next entry via the cursor. + nullable: true + readOnly: true + prev: + type: string + description: The url to the previous entry via the cursor. + nullable: true + readOnly: true + meta: + type: object + description: Metadata for the export query response. + properties: + after_cursor: + type: string + description: The cursor id for the next object. + nullable: true + readOnly: true + before_cursor: + type: string + description: The cursor id for the previous object. + nullable: true + readOnly: true + has_more: + type: boolean + description: Whether there are more items yet to be returned by the cursor. + readOnly: true + results: + type: array + description: May consist of tickets, users, groups, or organizations, as specified by the `result_type` property in each result object + items: + $ref: '#/components/schemas/SearchResultObject' + readOnly: true + example: + facets: null + links: + next: https://example.zendesk.com/api/v2/search/export?filter%5Btype%5D=ticket&page%5Bafter%5D=eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ%3D%3D&page%5Bsize%5D=100&query=hello%26page%5Bsize%5D%3D100%26filter%5Btype%5D%3Dticket + prev: null + meta: + after_cursor: eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ== + before_cursor: null + has_more: true + results: [ ] + SearchResponse: + type: object + properties: + count: + type: integer + description: The number of resources returned by the query corresponding to this page of results in the paginated response + readOnly: true + facets: + type: string + description: The facets corresponding to the search query + nullable: true + readOnly: true + next_page: + type: string + description: URL to the next page of results + nullable: true + readOnly: true + previous_page: + type: string + description: URL to the previous page of results + nullable: true + readOnly: true + results: + type: array + description: May consist of tickets, users, groups, or organizations, as specified by the `result_type` property in each result object + items: + $ref: '#/components/schemas/SearchResultObject' + readOnly: true + example: + count: 1 + facets: null + next_page: null + previous_page: null + results: + - created_at: "2018-04-06T03:17:05Z" + default: false + deleted: false + description: "" + id: 1835972 + name: Ragtail + result_type: group + updated_at: "2018-04-06T03:17:05Z" + url: https://example.zendesk.com/api/v2/groups/1835972 + SearchResultObject: + type: object + properties: + created_at: + type: string + description: When the resource was created + default: + type: boolean + description: Flag to indicate whether this is the default resource + deleted: + type: boolean + description: Flag to indicate whether or not resource has been deleted + description: + type: string + description: The description of the resource + id: + type: integer + description: The ID of the resource + name: + type: string + description: The name of the resource + result_type: + type: string + description: The type of the resource + updated_at: + type: string + description: When the resource was last updated + url: + type: string + description: The url of the resource + SecuritySettingsObject: + type: object + properties: + admins_can_set_user_passwords: + type: boolean + description: If administrators are allowed to set passwords for users. When disabled, administrators can only reset passwords + agent_session_timeout: + type: integer + description: The period of inactivity in minutes, before a team member is automatically signed out + assumable: + type: boolean + description: If account assumption is enabled + assumable_account_type: + type: boolean + description: Indicates if an account is always assumable, based on account type (e.g. always true for a trial account) + assumption_duration: + type: string + description: Describes how long the account can be assumed + enum: + - "off" + - day + - week + - month + - year + - always + assumption_expiration: + type: string + format: date-time + description: The time when assumption option expires + nullable: true + authentication: + type: object + description: Describes how users authenticate. See [Authentication](#authentication) + properties: + agent: + allOf: + - $ref: '#/components/schemas/RoleAuthenticationObject' + - type: object + properties: + office_365_allowed_tids: + type: string + office_365_enforce_tid: + type: boolean + password: + type: object + properties: + disallow_local_part_from_email: + type: boolean + failed_attempts_allowed: + type: integer + is_available: + type: boolean + default: true + max_sequence: + type: integer + nullable: true + password_complexity: + type: integer + password_duration: + type: integer + nullable: true + password_history_length: + type: integer + nullable: true + password_in_mixed_case: + type: boolean + description: If must include letters in mixed case + password_length: + type: integer + remote_bypass: + type: integer + end_user: + allOf: + - $ref: '#/components/schemas/RoleAuthenticationObject' + - type: object + properties: + facebook_login: + type: boolean + csp_blocking_enabled: + type: boolean + description: If Content Security Policy blocking is enabled + email_agent_when_sensitive_fields_changed: + type: boolean + description: If a notification is sent on password change for admins, agents and end users + end_user_session_timeout: + type: integer + description: The period of inactivity in minutes, before an end user is automatically signed out + ip: + type: object + description: Describes IP addresses restrictions. See [IP Restrictions](#ip-restrictions) + properties: + enable_agent_ip_restrictions: + type: boolean + ip_ranges: + type: string + ip_restriction_enabled: + type: boolean + maximum_session_duration: + type: integer + description: The maximum session duration, which is the maximum amount of time in minutes a team member can stay signed in. The session will expire after this duration or the inactivity timeout + maximum_session_duration_enabled: + type: boolean + description: If maximum session duration for team members is enabled + mobile_app_access: + type: boolean + description: If admins and agents can use the Zendesk Support mobile app + mobile_app_session_timeout: + type: integer + description: The period of inactivity in minutes, before a mobile app user gets signed out + two_factor_last_update: + type: string + format: date-time + description: The time when the two-factor authentication setting was last updated + SecuritySettingsResponse: + type: object + properties: + security_settings: + $ref: '#/components/schemas/SecuritySettingsObject' + SessionObject: + type: object + properties: + authenticated_at: + type: string + description: When the session was created + nullable: true + id: + type: integer + description: Automatically assigned when the session is created + last_seen_at: + type: string + description: The last approximate time this session was seen. This does not update on every request. + nullable: true + url: + type: string + description: The API URL of this session + nullable: true + user_id: + type: integer + description: The id of the user + nullable: true + example: + authenticated_at: "2014-11-18T17:24:29Z" + id: 3432 + last_seen_at: "2014-11-18T17:30:52Z" + url: https://company.zendesk.com/api/v2/users/12345/sessions/3432 + user_id: 12345 + required: + - id + SessionResponse: + type: object + properties: + session: + type: array + items: + $ref: '#/components/schemas/SessionObject' + SessionsResponse: + type: object + properties: + sessions: + type: array + items: + $ref: '#/components/schemas/SessionObject' + SharingAgreementObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the record was created + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: Name of this sharing agreement + partner_name: + type: string + description: 'Can be one of the following: "jira", null' + nullable: true + remote_subdomain: + type: string + description: Subdomain of the remote account or null if not associated with an account + status: + type: string + description: 'Can be one of the following: "accepted", "declined", "pending", "inactive", "failed", "ssl_error", "configuration_error"' + type: + type: string + description: 'Can be one of the following: "inbound", "outbound"' + updated_at: + type: string + format: date-time + description: The time the record was updated + readOnly: true + url: + type: string + description: URL of the sharing agreement record + readOnly: true + example: + created_at: "2012-02-20T22:55:29Z" + id: 88335 + name: Ticket Sharing + partner_name: jira + status: accepted + type: inbound + updated_at: "2013-02-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/agreements/88335 + SharingAgreementResponse: + type: object + properties: + sharing_agreement: + $ref: '#/components/schemas/SharingAgreementObject' + SharingAgreementsResponse: + type: object + properties: + sharing_agreements: + type: array + items: + $ref: '#/components/schemas/SharingAgreementObject' + SkillBasedRoutingAttributeDefinitions: + type: object + properties: + definitions: + type: object + properties: + conditions_all: + type: array + items: + type: object + properties: + subject: + type: string + title: + type: string + conditions_any: + type: array + items: + type: object + properties: + subject: + type: string + title: + type: string + SkillBasedRoutingAttributeObject: + type: object + properties: + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + id: + type: string + description: Automatically assigned when an attribute is created + readOnly: true + name: + type: string + description: The name of the attribute + updated_at: + type: string + format: date-time + description: When this record was last updated + readOnly: true + url: + type: string + description: URL of the attribute + readOnly: true + example: + created_at: "2017-12-01T19:29:31Z" + id: 15821cba-7326-11e8-b07e-950ba849aa27 + name: color + updated_at: "2017-12-01T19:29:31Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/15821cba-7326-11e8-b07e-950ba849aa27 + required: + - name + SkillBasedRoutingAttributeResponse: + type: object + properties: + attribute: + $ref: '#/components/schemas/SkillBasedRoutingAttributeObject' + SkillBasedRoutingAttributeValueObject: + type: object + properties: + agent_skill_priority: + type: string + description: The priority of the agent skill for this attribute value + enum: + - NORMAL + - HIGH + readOnly: true + attribute_id: + type: string + description: Id of the associated attribute + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + id: + type: string + description: Automatically assigned when an attribute value is created + readOnly: true + name: + type: string + description: The name of the attribute value + updated_at: + type: string + format: date-time + description: When this record was last updated + readOnly: true + url: + type: string + description: URL of the attribute value + readOnly: true + SkillBasedRoutingAttributeValueResponse: + type: object + properties: + attribute_value: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueObject' + SkillBasedRoutingAttributeValueWithoutPriorityObject: + type: object + properties: + attribute_id: + type: string + description: Id of the associated attribute + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + id: + type: string + description: Automatically assigned when an attribute value is created + readOnly: true + name: + type: string + description: The name of the attribute value + updated_at: + type: string + format: date-time + description: When this record was last updated + readOnly: true + url: + type: string + description: URL of the attribute value + readOnly: true + SkillBasedRoutingAttributeValuesError: + type: object + properties: + error: + type: object + properties: + message: + type: string + title: + type: string + SkillBasedRoutingAttributeValuesResponse: + type: object + properties: + attribute_values: + type: array + items: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueObject' + SkillBasedRoutingAttributeValuesWithoutPriorityResponse: + type: object + properties: + attribute_values: + type: array + items: + $ref: '#/components/schemas/SkillBasedRoutingAttributeValueWithoutPriorityObject' + SkillBasedRoutingAttributesResponse: + type: object + properties: + attributes: + type: array + items: + $ref: '#/components/schemas/SkillBasedRoutingAttributeObject' + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + SkillBasedRoutingTicketFulfilledResponse: + type: object + properties: + fulfilled_ticket_ids: + type: array + items: + type: integer + SupportAddressObject: + type: object + properties: + brand_id: + type: integer + description: The ID of the [brand](/api-reference/ticketing/account-configuration/brands/) + cname_status: + type: string + description: 'Whether all of the required CNAME records are set. Possible values: "unknown", "verified", "failed"' + enum: + - unknown + - verified + - failed + readOnly: true + created_at: + type: string + format: date-time + description: When the address was created + readOnly: true + default: + type: boolean + description: Whether the address is the account's default support address + dns_results: + type: string + description: 'Verification statuses for the domain and CNAME records. Possible types: "verified", "failed"' + enum: + - verified + - failed + readOnly: true + domain_verification_code: + type: string + description: 'Verification string to be added as a TXT record to the domain. Possible types: string or null.' + readOnly: true + domain_verification_status: + type: string + description: 'Whether the domain verification record is valid. Possible values: "unknown", "verified", "failed"' + enum: + - unknown + - verified + - failed + readOnly: true + email: + type: string + description: The email address. You can't change the email address of an existing support address. + forwarding_status: + type: string + description: 'Status of email forwarding. Possible values: "unknown", "waiting", "verified", or "failed"' + enum: + - unknown + - waiting + - verified + - failed + readOnly: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + name: + type: string + description: The name for the address + spf_status: + type: string + description: 'Whether the SPF record is set up correctly. Possible values: "unknown", "verified", "failed"' + enum: + - unknown + - verified + - failed + readOnly: true + updated_at: + type: string + format: date-time + description: When the address was updated + readOnly: true + example: + brand_id: 123 + cname_status: verified + created_at: "2015-07-20T22:55:29Z" + default: true + domain_verification_status: verified + email: support@example.zendesk.com + forwarding_status: unknown + id: 35436 + name: all + spf_status: verified + updated_at: "2016-09-21T20:15:20Z" + required: + - email + SupportAddressResponse: + type: object + properties: + recipient_address: + $ref: '#/components/schemas/SupportAddressObject' + SupportAddressesResponse: + type: object + properties: + recipient_addresses: + type: array + items: + $ref: '#/components/schemas/SupportAddressObject' + SuspendedTicketObject: + type: object + properties: + attachments: + type: array + description: The attachments, if any associated to this suspended ticket. See [Attachments](/api-reference/ticketing/tickets/ticket-attachments/) + items: + $ref: '#/components/schemas/AttachmentObject' + nullable: true + readOnly: true + author: + type: object + description: The author id (if available), name and email + allOf: + - $ref: '#/components/schemas/AuthorObject' + readOnly: true + brand_id: + type: integer + description: The id of the brand this ticket is associated with. Only applicable for Enterprise accounts + readOnly: true + cause: + type: string + description: Why the ticket was suspended + readOnly: true + cause_id: + type: integer + description: The ID of the cause + readOnly: true + content: + type: string + description: The content that was flagged + readOnly: true + created_at: + type: string + format: date-time + description: The ticket ID this suspended email is associated with, if available + readOnly: true + error_messages: + type: array + description: The error messages if any associated to this suspended ticket + items: + type: object + nullable: true + readOnly: true + id: + type: integer + description: Automatically assigned + readOnly: true + message_id: + type: string + description: The ID of the email, if available + readOnly: true + recipient: + type: string + description: The original recipient e-mail address of the ticket + readOnly: true + subject: + type: string + description: The value of the subject field for this ticket + readOnly: true + ticket_id: + type: integer + description: The ticket ID this suspended email is associated with, if available + readOnly: true + updated_at: + type: string + format: date-time + description: When the ticket was assigned + readOnly: true + url: + type: string + description: The API url of this ticket + readOnly: true + via: + $ref: '#/components/schemas/ViaObject' + example: + attachments: [ ] + author: + email: styx@example.com + id: 1111 + name: Mr. Roboto + brand_id: 123 + cause: Detected as spam + cause_id: 0 + content: Out Of Office Reply + created_at: "2009-07-20T22:55:29Z" + error_messages: null + id: 435 + message_id: Spambot@spam.co.evil + recipient: john@example.com + subject: Help, my printer is on fire! + ticket_id: 67321 + updated_at: "2011-05-05T10:38:52Z" + url: https://example.zendesk.com/api/v2/tickets/35436 + via: + channel: email + source: + from: + address: totallylegit@emailaddress.com + name: TotallyLegit + rel: null + to: + address: support@example.zendesk.com + name: Example Account + SuspendedTicketResponse: + type: object + properties: + suspended_ticket: + type: array + items: + $ref: '#/components/schemas/SuspendedTicketObject' + SuspendedTicketsAttachmentsResponse: + type: object + properties: + upload: + type: object + properties: + attachments: + type: array + items: + $ref: '#/components/schemas/AttachmentObject' + token: + type: string + description: Token for subsequent request + readOnly: true + SuspendedTicketsExportResponse: + type: object + properties: + export: + type: object + properties: + status: + type: string + readOnly: true + view_id: + type: string + readOnly: true + SuspendedTicketsResponse: + type: object + properties: + suspended_tickets: + type: array + items: + $ref: '#/components/schemas/SuspendedTicketObject' + SystemFieldOptionObject: + type: object + properties: + name: + type: string + description: Name of the system field option + readOnly: true + value: + type: string + description: Value of the system field option + readOnly: true + TagCountObject: + type: object + properties: + refreshed_at: + type: string + description: The time that the count value was last refreshed + readOnly: true + value: + type: integer + description: The count of tags created in the last 24 hours + readOnly: true + TagCountResponse: + type: object + properties: + count: + $ref: '#/components/schemas/TagCountObject' + TagListTagObject: + type: object + properties: + count: + type: integer + description: The number of tags + readOnly: true + name: + type: string + description: A name for the tag + TagUrlObject: + type: object + properties: + url: + type: string + description: The url associated to the api request + readOnly: true + TagsByObjectIdResponse: + type: object + properties: + tags: + type: array + description: An array of strings + items: + type: string + required: + - tags + TagsResponse: + type: object + properties: + count: + type: integer + description: The number of pages + readOnly: true + next_page: + type: string + description: The url of the previous page + nullable: true + readOnly: true + previous_page: + type: string + description: The url of the next page + nullable: true + readOnly: true + tags: + type: array + items: + $ref: '#/components/schemas/TagListTagObject' + TargetBasecamp: + type: object + properties: + message_id: + type: string + description: Can be filled if it is a "message" resource + password: + type: string + description: The 37Signals password for the Basecamp account (only writable) + project_id: + type: string + description: The ID of the project in Basecamp where updates should be pushed + resource: + type: string + description: '"todo" or "message"' + target_url: + type: string + description: The URL of your Basecamp account, including protocol and path + todo_list_id: + type: string + description: Can be filled if it is a "todo" resource + token: + type: string + description: Get the API token from My info > Show your tokens > Token for feed readers or the Basecamp API in your Basecamp account + username: + type: string + description: The 37Signals username of the account you use to log in to Basecamp + required: + - target_url + - token + - project_id + - resource + TargetCampfire: + type: object + properties: + preserve_format: + type: boolean + room: + type: string + ssl: + type: boolean + subdomain: + type: string + token: + type: string + required: + - subdomain + - room + - token + TargetClickatell: + type: object + properties: + api_id: + type: string + attribute: + type: string + description: Read-only + from: + type: string + method: + type: string + description: Read-only + password: + type: string + description: only writable + target_url: + type: string + description: Read-only + to: + type: string + us_small_business_account: + type: string + username: + type: string + required: + - username + - password + - api_id + - to + TargetCommonFields: + type: object + properties: + active: + type: boolean + description: Whether or not the target is activated + created_at: + type: string + format: date-time + description: The time the target was created + readOnly: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + title: + type: string + description: A name for the target + type: + type: string + description: A pre-defined target, such as "basecamp_target". See the additional attributes for the type that follow + required: + - title + - type + TargetEmail: + type: object + properties: + email: + type: string + subject: + type: string + required: + - email + - subject + TargetFailureObject: + type: object + properties: + consecutive_failure_count: + type: integer + description: Number of times the target failed consecutively + readOnly: true + created_at: + type: string + format: date-time + description: Time of the failure + readOnly: true + id: + type: integer + description: The ID of the target failure + readOnly: true + raw_request: + type: string + description: The raw message of the target request + readOnly: true + raw_response: + type: string + description: The raw response of the failure + readOnly: true + status_code: + type: integer + description: HTTP status code of the target failure + readOnly: true + target_name: + type: string + description: Name of the target failure + readOnly: true + url: + type: string + description: The API url of the failure record + readOnly: true + example: + consecutive_failure_count: 1 + created_at: "2017-09-05T10:38:52Z" + id: 6001326 + raw_request: "GET /api/v2/tickets HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ..." + raw_response: "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ..." + status_code: 401 + target_name: My URL Target + url: https://example.zendesk.com/api/v2/target_failures/6001326 + TargetFailureResponse: + type: object + properties: + target_failure: + $ref: '#/components/schemas/TargetFailureObject' + TargetFailuresResponse: + type: object + properties: + target_failures: + type: array + items: + $ref: '#/components/schemas/TargetFailureObject' + TargetFlowdock: + type: object + properties: + api_token: + type: string + required: + - api_token + TargetGetSatisfaction: + type: object + properties: + account_name: + type: string + email: + type: string + password: + type: string + description: only writable + target_url: + type: string + required: + - email + - password + - account_name + TargetHTTP: + type: object + properties: + content_type: + type: string + description: '"application/json", "application/xml", or "application/x-www-form-urlencoded"' + method: + type: string + description: '"get", "patch", "put", "post", or "delete"' + password: + type: string + description: only writable + target_url: + type: string + username: + type: string + required: + - target_url + - method + - content_type + TargetJira: + type: object + properties: + password: + type: string + description: only writable + target_url: + type: string + username: + type: string + required: + - target_url + - username + - password + TargetObject: + type: object + allOf: + - $ref: '#/components/schemas/TargetCommonFields' + - anyOf: + - $ref: '#/components/schemas/TargetBasecamp' + - $ref: '#/components/schemas/TargetCampfire' + - $ref: '#/components/schemas/TargetClickatell' + - $ref: '#/components/schemas/TargetEmail' + - $ref: '#/components/schemas/TargetFlowdock' + - $ref: '#/components/schemas/TargetGetSatisfaction' + - $ref: '#/components/schemas/TargetJira' + - $ref: '#/components/schemas/TargetPivotal' + - $ref: '#/components/schemas/TargetTwitter' + - $ref: '#/components/schemas/TargetURL' + - $ref: '#/components/schemas/TargetHTTP' + - $ref: '#/components/schemas/TargetYammer' + additionalProperties: true + example: + active: false + created_at: "2012-02-20T22:55:29Z" + id: 88335 + title: basecamp target + type: basecamp_target + url: https://company.zendesk.com/api/v2/targets/88335 + TargetPivotal: + type: object + properties: + owner_by: + type: string + project_id: + type: string + requested_by: + type: string + story_labels: + type: string + story_title: + type: string + story_type: + type: string + token: + type: string + required: + - token + - project_id + - story_type + - story_title + TargetResponse: + type: object + properties: + target: + $ref: '#/components/schemas/TargetObject' + TargetTwitter: + type: object + properties: + secret: + type: string + description: only writable + token: + type: string + TargetURL: + type: object + properties: + attribute: + type: string + method: + type: string + description: '"get"' + password: + type: string + description: only writable + target_url: + type: string + username: + type: string + required: + - target_url + - attribute + TargetYammer: + type: object + properties: + group_id: + type: string + token: + type: string + TargetsResponse: + type: object + properties: + targets: + type: array + items: + $ref: '#/components/schemas/TargetObject' + TaskListByTicketIdResponse: + type: object + properties: + count: + type: integer + next_page: + type: string + nullable: true + previous_page: + type: string + nullable: true + task_lists: + type: array + items: + $ref: '#/components/schemas/TaskListObject' + TaskListCreateRequest: + type: object + properties: + task_list: + type: object + properties: + task_list_template_id: + type: string + description: The id of the task list template to attach to the ticket + TaskListObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the task list was created + readOnly: true + description: + type: string + description: The description of the task list + readOnly: true + id: + type: string + description: Automatically assigned when a task list template is added to a ticket, creating the task list + readOnly: true + name: + type: string + description: The name of the task list + readOnly: true + task_count: + type: integer + description: The number of tasks in the task list + readOnly: true + task_list_template_id: + type: string + description: The ID of the task list template that the task list was created from + readOnly: true + ticket_id: + type: string + description: The ID of the ticket that the task list is attached to + readOnly: true + updated_at: + type: string + format: date-time + description: The time the task list was last updated + readOnly: true + example: + created_at: "2025-08-06T17:08:40Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01KFGZJGMQ3NA9DNX34Y5YGGYM + name: Onboarding checklist + task_count: 2 + task_list_template_id: 01K205PG0J2ET0B8AFHA106C1E + ticket_id: "1" + updated_at: "2025-08-06T17:08:40Z" + required: + - name + - task_list_template_id + - ticket_id + TaskListTemplateCreateRequest: + type: object + properties: + task_list_template: + $ref: '#/components/schemas/TaskListTemplateObject' + TaskListTemplateObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the task list template was created + readOnly: true + description: + type: string + description: The description of the task list template + id: + type: string + description: Automatically assigned when the task list template is created + readOnly: true + is_active: + type: boolean + description: TWhether the task list template is active and available for use by agents, or inactive and unavailable for use + name: + type: string + description: The name of the task list template + task_count: + type: integer + description: The number of tasks in the task list template + readOnly: true + tasks: + type: array + description: The tasks for the task list template. Only present for some endpoints. + items: + $ref: '#/components/schemas/TaskObject' + updated_at: + type: string + format: date-time + description: The time the task list template was last updated + readOnly: true + url: + type: string + description: URL of the task list template + readOnly: true + example: + created_at: "2025-08-06T17:08:40Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01K205PG0J2ET0B8AFHA106C1E + is_active: true + name: Onboarding checklist + task_count: 2 + tasks: + - created_at: "2025-08-06T17:08:40Z" + description: Ensure the employee has signed and returned all required documents before proceeding. + id: 01K3KVF20JE2QNA47FY6HJWQKB + name: Verify signed offer letter and contract + position: 1 + required: true + updated_at: "2025-08-06T17:08:40Z" + - created_at: "2025-08-06T17:08:40Z" + description: Submit the background check request and verify employee eligibility before onboarding. + id: 01K3KVF23JWZ5M98BJBQHENYZ9 + name: Initiate background check + position: 2 + required: false + updated_at: "2025-08-06T17:08:40Z" + updated_at: "2025-08-06T17:08:40Z" + required: + - name + TaskListTemplateResponse: + type: object + properties: + task_list_template: + $ref: '#/components/schemas/TaskListTemplateObject' + TaskListTemplateUpdateRequest: + type: object + properties: + task_list_template: + type: object + properties: + description: + type: string + description: The new description of the task list template + is_active: + type: boolean + description: The new active status of the task list template + name: + type: string + description: The new name of the task list template + tasks: + type: array + description: Tasks to create, update, or delete for the template + items: + anyOf: + - type: object + description: Delete an existing task + properties: + _destroy: + type: boolean + description: If true, deletes the task + enum: + - true + id: + type: string + description: The id of the task to delete from a task list template + required: + - id + - _destroy + - type: object + description: Update an existing task + properties: + description: + type: string + description: The new description of the task + id: + type: string + description: The id of the task to update + name: + type: string + description: The new name of the task + position: + type: integer + description: The new position of the task within the task list template + required: + type: boolean + description: Whether the task is required when an agent adds the task list to a ticket + required: + - id + - type: object + description: Create a new task + properties: + description: + type: string + description: The description of the task + name: + type: string + description: The name of the task + position: + type: integer + description: The position of the task within the task list template + required: + type: boolean + description: Whether the task is required when an agent adds the task list to a ticket + required: + - name + required: + - task_list_template + TaskListTemplatesResponse: + type: object + properties: + links: + type: object + properties: + next: + type: string + nullable: true + prev: + type: string + nullable: true + required: + - prev + - next + meta: + type: object + properties: + after_cursor: + type: string + nullable: true + before_cursor: + type: string + nullable: true + has_more: + type: boolean + required: + - has_more + - after_cursor + - before_cursor + task_list_templates: + type: array + items: + $ref: '#/components/schemas/TaskListTemplateObject' + TaskObject: + type: object + description: A task is an item in a task list template. + properties: + created_at: + type: string + format: date-time + description: The time the task was created + readOnly: true + description: + type: string + description: The description of the task + id: + type: string + description: Automatically assigned when the task is created + readOnly: true + name: + type: string + description: The name of the task + position: + type: integer + description: The position of the task in the task list template + required: + type: boolean + description: Whether the task is required to complete the task list + updated_at: + type: string + format: date-time + description: The time the task was last updated + readOnly: true + example: + created_at: "2025-08-26T18:50:21Z" + description: Ensure the employee has signed and returned all required documents before proceeding. + id: 01K3KVF20JE2QNA47FY6HJWQKB + name: Verify signed offer letter and contract + position: 1 + required: false + updated_at: "2025-08-26T18:50:21Z" + required: + - name + TasksByTaskListTemplateIdResponse: + type: object + properties: + count: + type: integer + next_page: + type: string + nullable: true + previous_page: + type: string + nullable: true + tasks: + type: array + items: + $ref: '#/components/schemas/TaskObject' + TicketAuditObject: + type: object + properties: + author_id: + type: integer + description: The user who created the audit + readOnly: true + created_at: + type: string + format: date-time + description: The time the audit was created + readOnly: true + events: + type: array + description: An array of the events that happened in this audit. See the [Ticket Audit events reference](/documentation/ticketing/reference-guides/ticket-audit-events-reference) + items: + type: object + additionalProperties: true + id: + type: integer + description: Automatically assigned when creating audits + readOnly: true + metadata: + type: object + description: Metadata for the audit, custom and system data + additionalProperties: true + readOnly: true + ticket_id: + type: integer + description: The ID of the associated ticket + readOnly: true + via: + $ref: '#/components/schemas/TicketAuditViaObject' + example: + author_id: 35436 + created_at: "2009-07-20T22:55:29Z" + events: + - attachments: [ ] + body: Thanks for your help! + id: 1564245 + public: true + type: Comment + - body: 'Ticket #47 has been updated' + id: 1564246 + subject: Your ticket has been updated + type: Notification + id: 35436 + metadata: + custom: + time_spent: 3m22s + system: + ip_address: 184.106.40.75 + ticket_id: 47 + via: + channel: web + TicketAuditResponse: + type: object + properties: + audit: + $ref: '#/components/schemas/TicketAuditObject' + TicketAuditViaObject: + type: object + description: Describes how the object was created. See the [Via object reference](/documentation/ticketing/reference-guides/via-object-reference) + properties: + channel: + type: string + description: 'This tells you how the ticket or event was created. Examples: "web", "mobile", "rule", "system"' + readOnly: true + source: + type: object + description: For some channels a source object gives more information about how or why the ticket or event was created + additionalProperties: true + readOnly: true + TicketAuditsCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + TicketAuditsResponse: + type: object + properties: + after_cursor: + type: string + readOnly: true + after_url: + type: string + readOnly: true + audits: + type: array + items: + $ref: '#/components/schemas/TicketAuditObject' + before_cursor: + type: string + readOnly: true + before_url: + type: string + readOnly: true + TicketAuditsResponseNoneCursor: + type: object + properties: + audits: + type: array + items: + $ref: '#/components/schemas/TicketAuditObject' + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + TicketBulkImportRequest: + type: object + properties: + tickets: + type: array + items: + $ref: '#/components/schemas/TicketImportInput' + TicketChatCommentRedactionResponse: + type: object + properties: + chat_event: + type: object + description: Chat event object + properties: + id: + type: integer + description: Id assigned to the chat event object + readOnly: true + type: + type: string + description: Type of chat event + readOnly: true + value: + type: object + description: The value of the chat event object + properties: + chat_id: + type: string + description: Id of the chat session + readOnly: true + history: + type: array + description: Chat events within the chat session + items: + type: object + additionalProperties: true + visitor_id: + type: string + description: Id assigned to the visitor + readOnly: true + readOnly: true + readOnly: true + example: + chat_event: + id: 1932802680168 + type: ChatStartedEvent + value: + chat_id: 2109.10502823.Sjuj2YrBpXwei + history: + - actor_id: 1900448983828 + actor_name: Visitor 36044085 + actor_type: end-user + chat_index: 0 + timestamp: 1632470783218 + type: ChatJoin + visitor_id: 10502823-16EkM3T6VNq7KMd + TicketCommentObject: + type: object + properties: + add_short_url: + type: boolean + description: Internal flag for adding short URLs to the comment + attachments: + type: array + description: Attachments, if any. See [Attachment](/api-reference/ticketing/tickets/ticket-attachments/) + items: + $ref: '#/components/schemas/AttachmentObject' + readOnly: true + audit_id: + type: integer + description: The id of the ticket audit record. See [Show Audit](/api-reference/ticketing/tickets/ticket_audits/#show-audit) + readOnly: true + author_id: + type: integer + description: The id of the comment author. If null or omitted on create, defaults to the authenticated user. See [Author id](#author-id) + nullable: true + body: + type: string + description: The comment string. See [Bodies](#bodies) + channel_back: + type: string + description: Internal channel back identifier for the comment + channel_source_id: + type: string + description: Internal channel source identifier for the comment + nullable: true + created_at: + type: string + format: date-time + description: The time the comment was created + readOnly: true + html_body: + type: string + description: The comment formatted as HTML. See [Bodies](#bodies) + id: + type: integer + description: Automatically assigned when the comment is created + readOnly: true + metadata: + type: object + description: System information (web client, IP address, etc.) and comment flags, if any. See [Comment flags](#comment-flags) + additionalProperties: true + readOnly: true + plain_body: + type: string + description: The comment presented as plain text. See [Bodies](#bodies) + readOnly: true + public: + type: boolean + description: true if a public comment; false if an internal note. The initial value set on ticket creation persists for any additional comment unless you change it + translate_to: + type: string + description: The locale code to translate the comment body to. + nullable: true + type: + type: string + description: '`Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)' + readOnly: true + uploads: + type: array + description: List of tokens received from [uploading files](/api-reference/ticketing/tickets/ticket-attachments/#upload-files) for comment attachments. The files are attached by creating or updating tickets with the tokens. See [Attaching files](/api-reference/ticketing/tickets/tickets/#attaching-files) in Tickets + items: + type: string + via: + $ref: '#/components/schemas/TicketAuditViaObject' + example: + attachments: + - content_type: text/plain + content_url: https://company.zendesk.com/attachments/crash.log + file_name: crash.log + id: 498483 + size: 2532 + thumbnails: [ ] + author_id: 123123 + body: Thanks for your help! + created_at: "2009-07-20T22:55:29Z" + id: 1274 + metadata: + system: + client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 + ip_address: 1.1.1.1 + latitude: -37.000000000001 + location: Melbourne, 07, Australia + longitude: 144.0000000000002 + via: + channel: web + source: + from: { } + rel: web_widget + to: { } + public: true + type: Comment + TicketCommentResponse: + type: object + properties: + comment: + $ref: '#/components/schemas/TicketCommentObject' + TicketCommentsCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + TicketCommentsResponse: + type: object + properties: + comments: + type: array + items: + $ref: '#/components/schemas/TicketCommentObject' + TicketContentPin: + type: object + properties: + account_id: + type: string + description: The ID of the account that owns the content pin. + content_id: + type: string + description: The ID of the content that is pinned. + content_type: + type: string + description: 'The type of content that is pinned. Example: external_content' + created_at: + type: string + format: date-time + description: The timestamp when the content pin was created. + id: + type: string + description: The unique identifier for the content pin. + locale: + type: string + description: The locale of the content pin. + nullable: true + ticket_id: + type: string + description: The ID of the ticket associated with the content pin. + url: + type: string + description: The URL to access the pinned content. + TicketCreateRequest: + type: object + properties: + system_metadata: + type: object + description: System metadata for the request, typically set by internal clients + additionalProperties: true + ticket: + $ref: '#/components/schemas/TicketObject' + TicketCreateVoicemailTicketInput: + type: object + allOf: + - $ref: '#/components/schemas/TicketObject' + - type: object + properties: + additional_tags: + type: array + description: An array of tags to add to the ticket + items: + type: string + remove_tags: + type: array + description: An array of tags to remove from the ticket + items: + type: string + via_id: + type: integer + description: Required for Create Ticket operation + enum: + - 44 + - 45 + - 46 + voice_comment: + $ref: '#/components/schemas/TicketCreateVoicemailTicketVoiceCommentInput' + TicketCreateVoicemailTicketRequest: + type: object + properties: + display_to_agent: + type: integer + description: Optional value such as the ID of the agent that will see the newly created ticket. + ticket: + type: object + description: Ticket object that lists the values to set when the ticket is created + allOf: + - $ref: '#/components/schemas/TicketCreateVoicemailTicketInput' + TicketCreateVoicemailTicketVoiceCommentInput: + type: object + properties: + answered_by_id: + type: integer + description: The agent who answered the call + call_duration: + type: integer + description: Duration in seconds of the call + from: + type: string + description: Incoming phone number + location: + type: string + description: Location of the caller (optional) + public: + type: boolean + description: Whether the voice comment is public + recording_url: + type: string + description: Incoming phone number + started_at: + type: string + description: Timestamp of the call starting time + to: + type: string + description: Dialed phone number + transcription_text: + type: string + description: Transcription of the call (optional) + TicketFieldCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + TicketFieldCustomStatusObject: + type: object + properties: + active: + type: boolean + description: If true, if the custom status is set to active. If false, the custom status is set to inactive + agent_label: + type: string + description: The label displayed to agents + created_at: + type: string + format: date-time + description: The date and time at which the custom ticket status was created + readOnly: true + default: + type: boolean + description: If true, the custom status is set to default. If false, the custom status is set to non-default + description: + type: string + description: The description of when the user should select this custom ticket status + end_user_description: + type: string + description: The description displayed to end users + end_user_label: + type: string + description: The label displayed to end users + id: + type: integer + description: Automatically assigned when the custom ticket status is created + readOnly: true + status_category: + type: string + description: The status category the custom ticket status belongs to + enum: + - new + - open + - pending + - hold + - solved + updated_at: + type: string + format: date-time + description: The date and time at which the custom ticket status was last updated + readOnly: true + TicketFieldObject: + type: object + properties: + active: + type: boolean + description: Whether this field is available + agent_can_edit: + type: boolean + description: Whether this field is editable by agents + readOnly: true + agent_description: + type: string + description: A description of the ticket field that only agents can see + collapsed_for_agents: + type: boolean + description: If true, the field is shown to agents by default. If false, the field is hidden alongside infrequently used fields. Classic interface only + created_at: + type: string + format: date-time + description: The time the custom ticket field was created + readOnly: true + creator_app_name: + type: string + description: Name of the app that created the ticket field, or a null value if no app created the ticket field + creator_user_id: + type: integer + description: The id of the user that created the ticket field, or a value of "-1" if an app created the ticket field + custom_field_options: + type: array + description: Required and presented for a custom ticket field of type "multiselect" or "tagger" + items: + $ref: '#/components/schemas/CustomFieldOptionObject' + custom_statuses: + type: array + description: List of customized ticket statuses. Only presented for a system ticket field of type "custom_status" + items: + $ref: '#/components/schemas/TicketFieldCustomStatusObject' + readOnly: true + description: + type: string + description: Describes the purpose of the ticket field to users + editable_in_portal: + type: boolean + description: Whether this field is editable by end users in Help Center + id: + type: integer + description: Automatically assigned when created + readOnly: true + position: + type: integer + description: The relative position of the ticket field on a ticket. Note that for accounts with ticket forms, positions are controlled by the different forms + raw_description: + type: string + description: The dynamic content placeholder if present, or the `description` value if not. See [Dynamic Content](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_title: + type: string + description: The dynamic content placeholder if present, or the `title` value if not. See [Dynamic Content](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_title_in_portal: + type: string + description: The dynamic content placeholder if present, or the "title_in_portal" value if not. See [Dynamic Content](/api-reference/ticketing/ticket-management/dynamic_content/) + regexp_for_validation: + type: string + description: For "regexp" fields only. The validation pattern for a field value to be deemed valid + nullable: true + relationship_filter: + type: object + description: A filter definition that allows your autocomplete to filter down results + relationship_target_type: + type: string + description: A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", or "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment". + removable: + type: boolean + description: If false, this field is a system field that must be present on all tickets + readOnly: true + required: + type: boolean + description: If true, agents must enter a value in the field to change the ticket status to solved + required_in_portal: + type: boolean + description: If true, end users must enter a value in the field to create the request + sub_type_id: + type: integer + description: For system ticket fields of type "priority" and "status". Defaults to 0. A "priority" sub type of 1 removes the "Low" and "Urgent" options. A "status" sub type of 1 adds the "On-Hold" option + system_field_options: + type: array + description: Presented for a system ticket field of type "tickettype", "priority" or "status" + items: + $ref: '#/components/schemas/SystemFieldOptionObject' + readOnly: true + tag: + type: string + description: For "checkbox" fields only. A tag added to tickets when the checkbox field is selected + nullable: true + title: + type: string + description: The title of the ticket field + title_in_portal: + type: string + description: The title of the ticket field for end users in Help Center + type: + type: string + description: System or custom field type. Editable for custom field types and only on creation. See [Create Ticket Field](#create-ticket-field) + updated_at: + type: string + format: date-time + description: The time the custom ticket field was last updated + readOnly: true + url: + type: string + description: The URL for this resource + readOnly: true + visible_in_portal: + type: boolean + description: Whether this field is visible to end users in Help Center + example: + active: true + agent_can_edit: true + agent_description: This is the agent only description for the subject field + collapsed_for_agents: false + created_at: "2009-07-20T22:55:29Z" + description: This is the subject field of a ticket + editable_in_portal: true + id: 34 + position: 21 + raw_description: This is the subject field of a ticket + raw_title: '{{dc.my_title}}' + raw_title_in_portal: '{{dc.my_title_in_portal}}' + regexp_for_validation: null + removable: false + required: true + required_in_portal: true + tag: null + title: Subject + title_in_portal: Subject + type: subject + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/ticket_fields/34 + visible_in_portal: true + required: + - type + - title + TicketFieldResponse: + type: object + properties: + ticket_field: + $ref: '#/components/schemas/TicketFieldObject' + TicketFieldValueInput: + type: object + description: A ticket custom field value assignment + properties: + id: + type: integer + format: bigid + description: The ID of the custom field + example: 27642 + value: + description: | + The value to assign to the custom field. + Type depends on the field configuration: + - Text/textarea: string + - Checkbox: boolean or "true"/"false" string + - Dropdown/tagger: string or array of strings (multi-select) + - Number/decimal: number or string representation + - Date: string (ISO 8601 format) + oneOf: + - type: string + - type: number + - type: boolean + - type: array + items: + type: string + example: "745" + required: + - id + TicketFieldsResponse: + type: object + properties: + ticket_fields: + type: array + items: + $ref: '#/components/schemas/TicketFieldObject' + TicketFieldsShowManyResponse: + type: object + properties: + count: + type: integer + description: Total count when not using cursor pagination + next_page: + type: string + description: URL or cursor to the next page when paginated; null otherwise + nullable: true + previous_page: + type: string + description: URL or cursor to the previous page when paginated; null otherwise + nullable: true + ticket_fields: + type: array + items: + $ref: '#/components/schemas/TicketFieldObject' + additionalProperties: false + required: + - ticket_fields + TicketFormObject: + type: object + properties: + active: + type: boolean + description: If the form is set as active + agent_conditions: + type: array + description: Array of condition sets for agent workspaces + items: + type: object + additionalProperties: true + created_at: + type: string + format: date-time + description: The time the ticket form was created + readOnly: true + default: + type: boolean + description: Is the form the default form for this account + deleted_at: + type: string + format: date-time + description: The time the ticket form was deleted + readOnly: true + display_name: + type: string + description: The name of the form that is displayed to an end user + end_user_conditions: + type: array + description: Array of condition sets for end user products + items: + type: object + additionalProperties: true + end_user_visible: + type: boolean + description: Is the form visible to the end user + id: + type: integer + description: Automatically assigned when creating ticket form + readOnly: true + in_all_brands: + type: boolean + description: Is the form available for use in all brands on this account + name: + type: string + description: The name of the form + position: + type: integer + description: The position of this form among other forms in the account, i.e. dropdown + raw_display_name: + type: string + description: The dynamic content placeholder, if present, or the "display_name" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + raw_name: + type: string + description: The dynamic content placeholder, if present, or the "name" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/) + restricted_brand_ids: + type: array + description: IDs of all brands that this ticket form is restricted to + items: + type: integer + readOnly: true + ticket_field_ids: + type: array + description: IDs of all ticket fields which are in this ticket form. The products use the order of the IDs to show the field values in the tickets + items: + type: integer + updated_at: + type: string + format: date-time + description: The time of the last update of the ticket form + readOnly: true + url: + type: string + description: URL of the ticket form + readOnly: true + example: + active: true + agent_conditions: + - child_fields: + - id: 101 + is_required: false + required_on_statuses: + statuses: + - new + - open + - pending + - hold + type: SOME_STATUSES + - id: 200 + is_required: true + required_on_statuses: + statuses: + - solved + type: SOME_STATUSES + parent_field_id: 100 + value: matching_value + - child_fields: + - id: 102 + is_required: true + required_on_statuses: + type: ALL_STATUSES + - id: 200 + is_required: false + required_on_statuses: + type: NO_STATUSES + parent_field_id: 101 + value: matching_value_2 + created_at: "2012-04-02T22:55:29Z" + default: true + deleted_at: "2012-05-02T22:55:29Z" + display_name: Snowboard Damage + end_user_conditions: + - child_fields: + - id: 101 + is_required: true + parent_field_id: 100 + value: matching_value + - child_fields: + - id: 202 + is_required: false + parent_field_id: 200 + value: matching_value + end_user_visible: true + id: 47 + in_all_brands: false + name: Snowboard Problem + position: 9999 + raw_display_name: '{{dc.my_display_name}}' + raw_name: Snowboard Problem + restricted_brand_ids: + - 47 + - 33 + - 22 + ticket_field_ids: + - 2 + - 4 + - 5 + - 10 + - 100 + - 101 + - 102 + - 200 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_forms/47 + required: + - name + TicketFormResponse: + type: object + properties: + ticket_form: + $ref: '#/components/schemas/TicketFormObject' + TicketFormStatusObject: + type: object + properties: + custom_status_id: + type: integer + description: The id of the associated custom status + id: + type: string + description: Automatically assigned when creating a ticket form + readOnly: true + ticket_form_id: + type: integer + description: The id of the associated ticket form + example: + custom_status_id: 7485541848574 + id: 01HFD81Y01D65FJ7EPNNM58GPK + ticket_form_id: 7485506877054 + TicketFormStatusesCreateParams: + type: object + properties: + custom_status_id: + type: integer + example: + custom_status_id: 12345 + required: + - custom_status_id + TicketFormStatusesParams: + type: object + properties: + ticket_form_status: + type: array + items: + $ref: '#/components/schemas/TicketFormStatusesCreateParams' + required: + - ticket_form_status + TicketFormStatusesResponse: + type: object + properties: + ticket_form_statuses: + type: array + items: + $ref: '#/components/schemas/TicketFormStatusObject' + maxItems: 1 + TicketFormStatusesUpdateParams: + type: object + properties: + _destroy: + type: string + description: If set to a value of \"1\" and an id value is passed, the server will delete the record + custom_status_id: + type: integer + id: + type: string + example: + _destroy: "1" + custom_status_id: 12345 + id: abcdef + TicketFormsResponse: + type: object + properties: + ticket_forms: + type: array + items: + $ref: '#/components/schemas/TicketFormObject' + TicketImportInput: + type: object + properties: + assignee_id: + type: integer + description: The agent currently assigned to the ticket + collaborators: + type: array + description: Users to add as cc's when creating a ticket. See [Setting Collaborators](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#setting-collaborators) + items: + $ref: '#/components/schemas/CollaboratorObject' + comment: + allOf: + - type: object + properties: + value: + type: string + description: The comment string value + additionalProperties: true + - $ref: '#/components/schemas/TicketCommentObject' + comments: + type: array + description: The conversation between requesters, collaborators, and agents + items: + allOf: + - type: object + properties: + value: + type: string + description: The comment string value + additionalProperties: true + - $ref: '#/components/schemas/TicketCommentObject' + created_at: + type: string + format: date-time + description: The time the ticket was created (for historical imports) + custom_fields: + type: array + description: | + Custom field values to set on the ticket. + Each entry specifies a field ID and its value. + items: + $ref: '#/components/schemas/TicketFieldValueInput' + custom_status_id: + type: integer + description: The custom ticket status id of the ticket + description: + type: string + description: Read-only first comment on the ticket. When [creating a ticket](#create-ticket), use `comment` to set the description. See [Description and first comment](#description-and-first-comment) + email_ccs: + type: array + description: An array of objects that represent agent or end users email CCs to add or delete from the ticket. See [Setting email CCs](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#setting-email-ccs) + items: + $ref: '#/components/schemas/EmailCCObject' + nullable: true + external_id: + type: string + description: An id you can use to link Zendesk Support tickets to local records + followers: + type: array + description: An array of objects that represent agent followers to add or delete from the ticket. See [Setting followers](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#setting-followers) + items: + $ref: '#/components/schemas/FollowerObject' + group_id: + type: integer + description: The group this ticket is assigned to + priority: + $ref: '#/components/schemas/TicketPriorityEnum' + recipient: + type: string + description: The original recipient e-mail address of the ticket + requester_id: + type: integer + description: The user who requested this ticket + solved_at: + type: string + format: date-time + description: The time the ticket was solved (for historical imports) + status: + type: string + description: The state of the ticket + enum: + - new + - open + - pending + - hold + - solved + - closed + subject: + type: string + description: The value of the subject field for this ticket + tags: + type: array + description: The array of tags applied to this ticket + items: + type: string + updated_at: + type: string + format: date-time + description: The time the ticket was last updated (for historical imports) + via: + type: object + description: | + An object explaining how the ticket was created. See the [Via object reference](/documentation/ticketing/reference-guides/via-object-reference) + properties: + channel: + type: string + description: This tells you how the ticket or event was created + source: + type: object + description: For some channels a source object gives more information about how or why the ticket or event was created + additionalProperties: true + TicketImportRequest: + type: object + properties: + ticket: + $ref: '#/components/schemas/TicketImportInput' + TicketMergeInput: + type: object + properties: + ids: + type: array + description: Ids of tickets to merge into the target ticket + items: + type: integer + source_comment: + type: string + description: Private comment to add to the source ticket + source_comment_is_public: + type: boolean + description: Whether comment in source tickets are public or private + target_comment: + type: string + description: Private comment to add to the target ticket + target_comment_is_public: + type: boolean + description: Whether comment in target ticket is public or private + required: + - ids + TicketMetricEventBaseObject: + title: Ticket Metric Events + type: object + properties: + deleted: + type: boolean + description: If true, the event has been deleted + readOnly: true + id: + type: integer + description: Automatically assigned when the record is created + readOnly: true + instance_id: + type: integer + description: The instance of the metric associated with the event. See [instance_id](#instance_id) + readOnly: true + metric: + type: string + description: The metric being tracked + enum: + - agent_work_time + - pausable_update_time + - periodic_update_time + - reply_time + - requester_wait_time + - resolution_time + - group_ownership_time + readOnly: true + ticket_id: + type: integer + description: Id of the associated ticket + readOnly: true + time: + type: string + format: date-time + description: The time the event occurred + readOnly: true + type: + type: string + description: The type of the metric event. See [Ticket metric event types reference](/documentation/ticketing/reference-guides/ticket-metric-event-types-reference) + enum: + - activate + - pause + - fulfill + - apply_sla + - apply_group_sla + - breach + - update_status + - measure + readOnly: true + example: + id: 926256957613 + instance_id: 1 + metric: agent_work_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: measure + TicketMetricEventBreachObject: + title: Ticket Metric Event + type: object + allOf: + - $ref: '#/components/schemas/TicketMetricEventBaseObject' + - type: object + properties: + deleted: + type: boolean + description: Available if `type` is `breach`. In general, you can ignore any breach event when `deleted` is true. See [deleted](#deleted) + readOnly: true + TicketMetricEventGroupSLAObject: + title: Ticket Metric Event + type: object + allOf: + - $ref: '#/components/schemas/TicketMetricEventBaseObject' + - type: object + properties: + group_sla: + type: object + description: Available if `type` is "apply_group_sla". The Group SLA policy and target being enforced on the ticket and metric in question, if any. See [group_sla](#group_sla) + readOnly: true + TicketMetricEventSLAObject: + title: Ticket Metric Event + type: object + allOf: + - $ref: '#/components/schemas/TicketMetricEventBaseObject' + - type: object + properties: + sla: + type: object + description: Available if `type` is `apply_sla`. The SLA policy and target being enforced on the ticket and metric in question, if any. See [sla](#sla) + readOnly: true + TicketMetricEventUpdateStatusObject: + title: Ticket Metric Event + type: object + allOf: + - $ref: '#/components/schemas/TicketMetricEventBaseObject' + - type: object + properties: + status: + type: object + description: Available if `type` is `update_status`. Minutes since the metric has been open. See [status](#status) + readOnly: true + TicketMetricEventsResponse: + type: object + allOf: + - type: object + properties: + ticket_metric_events: + type: array + items: + $ref: '#/components/schemas/TicketMetricEventBaseObject' + - type: object + properties: + count: + type: integer + end_time: + type: integer + next_page: + type: string + TicketMetricObject: + type: object + properties: + agent_wait_time_in_minutes: + type: object + description: Number of minutes the agent spent waiting during calendar and business hours + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + assigned_at: + type: string + format: date-time + description: When the ticket was assigned + readOnly: true + assignee_stations: + type: integer + description: Number of assignees the ticket had + readOnly: true + assignee_updated_at: + type: string + format: date-time + description: When the assignee last updated the ticket + readOnly: true + created_at: + type: string + format: date-time + description: When the record was created + readOnly: true + custom_status_updated_at: + type: string + format: date-time + description: The date and time the ticket's custom status was last updated + readOnly: true + first_resolution_time_in_minutes: + type: object + description: Number of minutes to the first resolution time during calendar and business hours + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + full_resolution_time_in_minutes: + type: object + description: Number of minutes to the full resolution during calendar and business hours + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + group_stations: + type: integer + description: Number of groups the ticket passed through + readOnly: true + id: + type: integer + description: Automatically assigned when the client is created + readOnly: true + initially_assigned_at: + type: string + format: date-time + description: When the ticket was initially assigned + readOnly: true + latest_comment_added_at: + type: string + format: date-time + description: When the latest comment was added + readOnly: true + on_hold_time_in_minutes: + type: object + description: Number of minutes on hold + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + reopens: + type: integer + description: Total number of times the ticket was reopened + readOnly: true + replies: + type: integer + description: The number of public replies added to a ticket by an agent + readOnly: true + reply_time_in_minutes: + type: object + description: Number of minutes to the first reply during calendar and business hours + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + reply_time_in_seconds: + type: object + description: Number of seconds to the first reply during calendar hours, only available for Messaging tickets + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + requester_updated_at: + type: string + format: date-time + description: When the requester last updated the ticket + readOnly: true + requester_wait_time_in_minutes: + type: object + description: Number of minutes the requester spent waiting during calendar and business hours + allOf: + - $ref: '#/components/schemas/TicketMetricTimeObject' + readOnly: true + solved_at: + type: string + format: date-time + description: When the ticket was solved + readOnly: true + status_updated_at: + type: string + format: date-time + description: When the status of the ticket was last updated + readOnly: true + ticket_id: + type: integer + description: Id of the associated ticket + readOnly: true + updated_at: + type: string + format: date-time + description: When the record was last updated + readOnly: true + url: + type: string + description: The API url of the ticket metric + readOnly: true + example: + agent_wait_time_in_minutes: + business: 737 + calendar: 2391 + assigned_at: "2011-05-05T10:38:52Z" + assignee_stations: 1 + assignee_updated_at: "2011-05-06T10:38:52Z" + created_at: "2009-07-20T22:55:29Z" + custom_status_updated_at: "2011-05-09T10:38:52Z" + first_resolution_time_in_minutes: + business: 737 + calendar: 2391 + full_resolution_time_in_minutes: + business: 737 + calendar: 2391 + group_stations: 7 + id: 33 + initially_assigned_at: "2011-05-03T10:38:52Z" + latest_comment_added_at: "2011-05-09T10:38:52Z" + on_hold_time_in_minutes: + business: 637 + calendar: 2290 + reopens: 55 + replies: 322 + reply_time_in_minutes: + business: 737 + calendar: 2391 + reply_time_in_seconds: + calendar: 143460 + requester_updated_at: "2011-05-07T10:38:52Z" + requester_wait_time_in_minutes: + business: 737 + calendar: 2391 + solved_at: "2011-05-09T10:38:52Z" + status_updated_at: "2011-05-04T10:38:52Z" + ticket_id: 4343 + updated_at: "2011-05-05T10:38:52Z" + TicketMetricTimeObject: + type: object + properties: + business: + type: integer + description: Time in business hours + readOnly: true + calendar: + type: integer + description: Time in calendar hours + readOnly: true + TicketMetricsByTicketMetricIdResponse: + type: object + properties: + ticket_metric: + type: array + items: + $ref: '#/components/schemas/TicketMetricObject' + TicketMetricsResponse: + type: object + properties: + ticket_metrics: + type: array + items: + $ref: '#/components/schemas/TicketMetricObject' + TicketObject: + type: object + properties: + additional_collaborators: + type: array + description: Write only. An array of numeric IDs, emails, or objects containing name and email properties. See [Setting Collaborators](/api-reference/ticketing/tickets/tickets/#setting-collaborators). An email notification is sent to them when the ticket is updated + items: + $ref: '#/components/schemas/CollaboratorObject' + writeOnly: true + allow_attachments: + type: boolean + description: Permission for agents to add add attachments to a comment. Defaults to true + readOnly: true + allow_channelback: + type: boolean + description: Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket + readOnly: true + assignee_email: + type: string + format: email + description: Write only. The email address of the agent to assign the ticket to + writeOnly: true + assignee_id: + type: integer + format: bigid + description: The agent currently assigned to the ticket + nullable: true + attribute_value_ids: + type: array + description: Write only. An array of the IDs of attribute values to be associated with the ticket + items: + type: integer + writeOnly: true + brand_id: + type: integer + format: bigid + description: The id of the brand this ticket is associated with. See [Setting up multiple brands](https://support.zendesk.com/hc/en-us/articles/4408829476378) + nullable: true + collaborator_ids: + type: array + description: The ids of users currently CC'ed on the ticket + items: + type: integer + format: bigid + collaborators: + type: array + description: Write only. Users to add as cc's when creating a ticket. See [Setting Collaborators](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#setting-collaborators) + items: + $ref: '#/components/schemas/CollaboratorObject' + writeOnly: true + comment: + $ref: '#/components/schemas/TicketCommentObject' + created_at: + type: string + format: date-time + description: When this record was created + readOnly: true + custom_fields: + type: array + description: | + Custom field values to set on the ticket. + Each entry specifies a field ID and its value. + See [Setting custom field values](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#setting-custom-field-values) + items: + $ref: '#/components/schemas/TicketFieldValueInput' + custom_status_id: + type: integer + format: bigid + description: The custom ticket status id of the ticket. See [custom ticket statuses](#custom-ticket-statuses) + nullable: true + description: + type: string + description: | + The first comment on the ticket. When [creating a ticket](#create-ticket), use `comment` to set the description. + See [Description and first comment](#description-and-first-comment). + On create, can be set directly as an alternative to `comment`. Silently ignored on update. + due_at: + type: string + format: date-time + description: If this is a ticket of type "task" it has a due date. Due date format uses [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format + nullable: true + email_cc_ids: + type: array + description: The ids of agents or end users currently CC'ed on the ticket. See [CCs and followers resources](https://support.zendesk.com/hc/en-us/articles/360020585233) in the Support Help Center + items: + type: integer + readOnly: true + email_ccs: + type: array + description: Write only. An array of objects that represent agent or end users email CCs to add or delete from the ticket. See [Setting email CCs](/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#setting-email-ccs). Ignored when [CCs and followers](https://support.zendesk.com/hc/en-us/articles/360020585233) is not enabled + items: + $ref: '#/components/schemas/EmailCCObject' + nullable: true + writeOnly: true + encoded_id: + type: string + description: An encoded string representing the ticket's unique identifier + readOnly: true + external_id: + type: string + description: An id you can use to link Zendesk Support tickets to local records + nullable: true + fields: + type: array + description: | + Alias for custom_fields. Custom field values to set on the ticket. + Each entry specifies a field ID and its value. + items: + $ref: '#/components/schemas/TicketFieldValueInput' + follower_ids: + type: array + description: The ids of agents currently following the ticket. Ignored when [CCs and followers](https://support.zendesk.com/hc/en-us/articles/360020585233) is not enabled + items: + type: integer + readOnly: true + followers: + type: array + description: Write only. An array of objects that represents agent followers to add or delete from the ticket. See [Setting followers](/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#setting-followers). Ignored when [CCs and followers](https://support.zendesk.com/hc/en-us/articles/360020585233) is not enabled + items: + $ref: '#/components/schemas/FollowerObject' + writeOnly: true + followup_ids: + type: array + description: The ids of the followups created from this ticket. Ids are only visible once the ticket is closed + items: + type: integer + readOnly: true + forum_topic_id: + type: integer + format: bigid + description: The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated + from_messaging_channel: + type: boolean + description: If true, the ticket's [via type](/documentation/ticketing/reference-guides/via-object-reference/) is a messaging channel. + readOnly: true + generated_timestamp: + type: integer + description: A Unix timestamp that represents the most accurate reading of when this record was last updated. It is updated for all ticket updates, including system updates + readOnly: true + group_id: + type: integer + format: bigid + description: The group this ticket is assigned to + nullable: true + has_incidents: + type: boolean + description: Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false. + readOnly: true + id: + type: integer + description: Automatically assigned when the ticket is created + readOnly: true + is_public: + type: boolean + description: Is true if any comments are public, false otherwise + readOnly: true + macro_id: + type: integer + format: bigid + description: Write only. A single macro ID to be recorded in the ticket audit + writeOnly: true + macro_ids: + type: array + description: Write only. List of macro IDs to be recorded in the ticket audit + items: + type: integer + format: bigid + writeOnly: true + metadata: + type: object + description: Write only. Metadata for the audit. In the `audit` object, the data is specified in the `custom` property of the `metadata` object. See [Setting Metadata](/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#setting-metadata) + additionalProperties: true + writeOnly: true + organization_id: + type: integer + format: bigid + description: The organization of the requester. You can only specify the ID of an organization associated with the requester. See [Organization Memberships](/api-reference/ticketing/organizations/organization_memberships/) + nullable: true + origin_zrn: + type: string + description: Write only. The Zendesk Resource Name (ZRN) of the origin for this ticket + writeOnly: true + priority: + type: string + description: The urgency with which the ticket should be addressed + enum: + - urgent + - high + - normal + - low + nullable: true + problem_id: + type: integer + format: bigid + description: For tickets of type "incident", the ID of the problem the incident is linked to + nullable: true + raw_subject: + type: string + description: | + The dynamic content placeholder, if present, or the "subject" value, if not. See [Dynamic Content Items](/api-reference/ticketing/ticket-management/dynamic_content/). + When set on create or update, overrides the `subject` field. + recipient: + type: string + description: The original recipient e-mail address of the ticket. Notification emails for the ticket are sent from this address + requester: + description: | + Write only. Alternative to requester_id for specifying the ticket requester. + + Can be provided as: + - Email string: "user@example.com" + - User ID integer: 12345 + - User object: {name: "John Doe", email: "john@example.com"} + + If both requester and requester_id are provided, requester_id takes precedence. + + When creating a ticket, if the user doesn't exist, they may be created + automatically depending on account settings. + oneOf: + - type: string + description: Email address or username + - type: integer + description: User ID + - type: object + description: User creation attributes + properties: + email: + type: string + format: email + description: The user's primary email address + locale: + type: string + description: The user's locale (e.g., "en-US") + locale_id: + type: integer + description: The user's locale ID + name: + type: string + description: The user's name + organization_id: + type: integer + description: The organization ID to associate with the user + role: + type: string + description: The user's role (e.g., "end-user", "agent", "admin") + verified: + type: boolean + description: Whether the user's email is verified + writeOnly: true + requester_id: + type: integer + format: bigid + description: The user who requested this ticket + nullable: true + safe_update: + type: boolean + description: Write only. Optional boolean. When true and an `updated_stamp` date is included, protects against ticket update collisions and returns a message to let you know if one occurs. See [Protecting against ticket update collisions](/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#protecting-against-ticket-update-collisions). A value of false has the same effect as true. Omit the property to force the updates to not be safe + writeOnly: true + satisfaction_probability: + type: number + description: The predicted satisfaction probability score + readOnly: true + satisfaction_rating: + type: object + description: The satisfaction rating of the ticket, if it exists, or the state of satisfaction, "offered" or "unoffered". The value is null for plan types that don't support CSAT + additionalProperties: true + readOnly: true + sharing_agreement_ids: + type: array + description: An array of the numeric IDs of sharing agreements. Note that this replaces any existing agreements + items: + type: integer + format: bigid + sharing_agreements: + description: | + Write only. Sharing agreement configuration for the ticket. + Can be a single object or array of objects. + oneOf: + - type: object + properties: + custom_fields: + type: array + items: + $ref: '#/components/schemas/TicketFieldValueInput' + id: + type: integer + format: bigid + - type: array + items: + type: object + additionalProperties: true + writeOnly: true + status: + type: string + description: | + The state of the ticket. + + If your account has activated custom ticket statuses, this is the ticket's + status category. See [custom ticket statuses](#custom-ticket-statuses) + enum: + - new + - open + - pending + - hold + - solved + - closed + subject: + type: string + description: | + The value of the subject field for this ticket. See [Subject](/api-reference/ticketing/tickets/tickets/#subject) + nullable: true + submitter: + description: | + Write only. Alternative to submitter_id for specifying the ticket submitter. + Can be provided as a user email string or user ID integer. + oneOf: + - type: string + description: Email address + - type: integer + description: User ID + writeOnly: true + submitter_id: + type: integer + format: bigid + description: | + The user who submitted the ticket. The submitter always becomes the + author of the first comment on the ticket. + + If not specified, defaults to the authenticated user. + nullable: true + suspended_ticket_id: + type: integer + format: bigid + description: Write only. The ID of the suspended ticket being recovered + writeOnly: true + suspension_type_id: + type: integer + format: bigid + description: Write only. The suspension type ID when recovering a suspended ticket + writeOnly: true + system_metadata: + type: object + description: Write only. System metadata for the ticket, typically set by internal clients + properties: + client: + type: string + ip_address: + type: string + writeOnly: true + tags: + description: The tags applied to this ticket. Unless otherwise specified, the [set tag](/api-reference/ticketing/ticket-management/tags/#set-tags) behavior is used, which overwrites and replaces existing tags + oneOf: + - type: array + description: An array of tag strings + items: + type: string + - type: string + description: A single tag string + tde_workspace: + type: object + description: Write only. TDE workspace information for the ticket + properties: + previous_workspace: + type: object + properties: + id: + type: integer + format: bigid + title: + type: string + type: + type: string + enum: + - ADD + - CHANGE + - DELETE + workspace: + type: object + properties: + id: + type: integer + format: bigid + title: + type: string + writeOnly: true + ticket_form_id: + type: integer + format: bigid + description: Enterprise only. The id of the ticket form to render for the ticket + nullable: true + tpe_voice_comment: + type: object + description: Write only. A TPE voice comment for Talk Partner Edition tickets + properties: + agent_id: + type: integer + format: bigid + nullable: true + answering_machine_detection_status: + type: string + nullable: true + app_id: + type: integer + format: bigid + app_name: + type: string + nullable: true + author_id: + type: integer + format: bigid + call_connected_at: + type: string + format: date-time + nullable: true + call_disposition: + type: string + nullable: true + call_ended_at: + type: string + format: date-time + nullable: true + call_id: + type: integer + format: bigid + call_recording_consent: + type: string + nullable: true + call_recording_consent_action: + type: string + nullable: true + call_recording_consent_keypress: + type: string + nullable: true + call_started_at: + type: string + format: date-time + call_type: + type: string + nullable: true + callback_number: + type: string + nullable: true + callback_requested_at: + type: string + format: date-time + nullable: true + completion_status: + type: string + nullable: true + connection_attempts: + type: integer + nullable: true + consultation_time: + type: integer + nullable: true + direction: + type: string + disconnection_reason: + type: string + nullable: true + dnis: + type: string + nullable: true + duration: + type: integer + nullable: true + end_user_id: + type: integer + format: bigid + nullable: true + end_user_location: + type: string + nullable: true + exceeded_queue_time: + type: boolean + nullable: true + extension: + type: string + nullable: true + external_id: + type: string + from_line: + type: string + from_line_nickname: + type: string + nullable: true + hold_time: + type: integer + nullable: true + intent: + type: string + nullable: true + ivr_destination_group_name: + type: string + nullable: true + ivr_time_spent: + type: integer + nullable: true + language: + type: string + nullable: true + line_type: + type: string + longest_hold_time: + type: integer + nullable: true + number_of_holds: + type: integer + nullable: true + outside_business_hours: + type: boolean + nullable: true + overflowed_to: + type: string + nullable: true + phone_name: + type: string + nullable: true + public: + type: boolean + quality_score: + type: integer + nullable: true + queue_name: + type: string + nullable: true + queue_time: + type: integer + nullable: true + recorded: + type: boolean + recording_time: + type: integer + nullable: true + recording_type: + type: string + recording_url: + type: string + nullable: true + sentiment_agent: + type: string + nullable: true + sentiment_call: + type: string + nullable: true + sentiment_customer: + type: string + nullable: true + sentiment_trend: + type: string + nullable: true + short_summary: + type: string + nullable: true + summary: + type: string + nullable: true + talk_time: + type: integer + nullable: true + time_to_answer: + type: integer + nullable: true + title: + type: string + to_line: + type: string + to_line_nickname: + type: string + nullable: true + transcript: + type: string + nullable: true + via_id: + type: integer + video_recording_url: + type: string + nullable: true + voicemail: + type: boolean + nullable: true + voicemail_requested_at: + type: string + format: date-time + nullable: true + wait_time: + type: integer + nullable: true + writeOnly: true + type: + type: string + description: The type of this ticket + enum: + - problem + - incident + - question + - task + nullable: true + updated_at: + type: string + format: date-time + description: When this record last got updated. It is updated only if the update generates a [ticket event](#incremental-ticket-event-export) + readOnly: true + updated_stamp: + type: string + format: date-time + description: Write only. Datetime of last update received from API. See the `safe_update` property + writeOnly: true + url: + type: string + description: The API url of this ticket + readOnly: true + via: + $ref: '#/components/schemas/ViaObject' + via_followup_source_id: + type: integer + format: bigid + description: Write only. The id of a closed ticket when creating a follow-up ticket. See [Creating a follow-up ticket](/documentation/ticketing/managing-tickets/creating-and-updating-tickets#creating-a-follow-up-ticket) + writeOnly: true + via_id: + type: integer + description: Write only. For more information, see the [Via object reference](/documentation/ticketing/reference-guides/via-object-reference/) + writeOnly: true + voice_comment: + type: object + description: Write only. A voice comment for Talk tickets. See [Creating voicemail tickets](/api-reference/voice/talk-api/voicemail-tickets/) + properties: + answered_by_id: + type: integer + format: bigid + description: The agent who answered the call + nullable: true + call_duration: + type: integer + description: Duration of the call in seconds + from: + type: string + description: Incoming phone number + location: + type: string + description: Location of the caller + nullable: true + recording_url: + type: string + description: URL of the recording + nullable: true + to: + type: string + description: Dialed phone number + transcription_text: + type: string + description: Transcription of the call + nullable: true + additionalProperties: true + writeOnly: true + example: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + TicketPriorityEnum: + type: string + description: The urgency with which the ticket should be addressed. + enum: + - urgent + - high + - normal + - low + TicketRelatedInformation: + type: object + properties: + followup_source_ids: + type: array + items: + type: string + description: Sources to follow up + from_archive: + type: boolean + description: Is true if the current ticket is archived + incidents: + type: integer + description: A count of related incident occurrences + jira_issue_ids: + type: array + items: + type: string + description: Associated jira issues + topic_id: + type: string + description: Related topic in the Web portal (deprecated feature) + nullable: true + TicketResponse: + type: object + properties: + ticket: + $ref: '#/components/schemas/TicketObject' + TicketSkipCreation: + type: object + properties: + skip: + $ref: '#/components/schemas/TicketSkipObject' + TicketSkipObject: + type: object + properties: + created_at: + type: string + format: date-time + description: Time the skip was created + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + reason: + type: string + description: Reason for skipping the ticket + readOnly: true + ticket: + type: object + description: The skipped ticket. See the [Ticket object reference](/api-reference/ticketing/tickets/tickets/#json-format) + allOf: + - $ref: '#/components/schemas/TicketObject' + ticket_id: + type: integer + description: ID of the skipped ticket + readOnly: true + updated_at: + type: string + format: date-time + description: Time the skip was last updated + readOnly: true + user_id: + type: integer + description: ID of the skipping agent + readOnly: true + example: + created_at: "2015-09-30T21:44:03Z" + id: 1 + reason: I have no idea. + ticket: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 123 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + ticket_id: 123 + updated_at: "2015-09-30T21:44:03Z" + user_id: 456 + TicketSkipsResponse: + type: object + properties: + skips: + type: array + items: + $ref: '#/components/schemas/TicketSkipObject' + TicketUpdateRequest: + type: object + properties: + system_metadata: + type: object + description: System metadata for the request, typically set by internal clients + additionalProperties: true + ticket: + $ref: '#/components/schemas/TicketObject' + TicketUpdateResponse: + type: object + properties: + audit: + $ref: '#/components/schemas/AuditObject' + ticket: + $ref: '#/components/schemas/TicketObject' + TicketsCreateRequest: + type: object + properties: + tickets: + type: array + items: + $ref: '#/components/schemas/TicketObject' + TicketsResponse: + type: object + properties: + tickets: + type: array + items: + $ref: '#/components/schemas/TicketObject' + TicketsUpdateRequest: + oneOf: + - type: object + properties: + ticket: + type: object + allOf: + - $ref: '#/components/schemas/TicketObject' + - type: object + properties: + additional_tags: + type: array + description: Tags to add to existing tags without overwriting + items: + type: string + remove_tags: + type: array + description: Tags to remove from the ticket + items: + type: string + required: + - ticket + - type: object + properties: + tickets: + type: array + items: + allOf: + - $ref: '#/components/schemas/TicketObject' + - type: object + properties: + additional_tags: + type: array + description: Tags to add to existing tags without overwriting + items: + type: string + id: + type: integer + description: The ID of the ticket to update + remove_tags: + type: array + description: Tags to remove from the ticket + items: + type: string + required: + - id + maxItems: 100 + required: + - tickets + TimeBasedExportIncrementalTicketsResponse: + type: object + description: | + See [Tickets](/api-reference/ticketing/tickets/tickets/) for a detailed example. + properties: + count: + type: integer + end_of_stream: + type: boolean + end_time: + type: integer + next_page: + type: string + nullable: true + tickets: + type: array + items: + $ref: '#/components/schemas/TicketObject' + example: + count: 2 + end_of_stream: true + end_time: 1390362485 + next_page: https://{subdomain}.zendesk.com/api/v2/incremental/tickets?per_page=3&start_time=1390362485 + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + TimeBasedExportIncrementalUsersResponse: + type: object + properties: + count: + type: integer + end_of_stream: + type: boolean + end_time: + type: integer + next_page: + type: string + nullable: true + users: + type: array + items: + $ref: '#/components/schemas/UserObject' + example: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + users: + - active: true + alias: Mr. Johnny + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + TrialAccountObject: + type: object + properties: + name: + type: string + description: The name of the account + subdomain: + type: string + description: The subdomain of the account + url: + type: string + description: The URL of the account + TrialAccountResponse: + type: object + properties: + account: + $ref: '#/components/schemas/TrialAccountObject' + TriggerActionDefinitionObject: + type: object + properties: + group: + type: string + nullable: + type: boolean + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + TriggerActionDiffObject: + type: object + properties: + field: + type: array + description: An array of [change](#change) objects. + items: + $ref: '#/components/schemas/TriggerChangeObject' + value: + type: array + description: An array of [change](#change) objects. + items: + $ref: '#/components/schemas/TriggerChangeObject' + example: + field: + - change: + + content: solved + value: + - change: '-' + content: open + TriggerActionObject: + type: object + properties: + field: + type: string + value: + oneOf: + - type: string + - type: integer + - type: array + items: + oneOf: + - type: string + - type: integer + example: + field: status + value: solved + TriggerBatchRequest: + type: object + properties: + active: + type: boolean + category_id: + type: string + id: + type: string + position: + type: integer + format: int64 + required: + - id + TriggerBulkUpdateItem: + type: object + properties: + active: + type: boolean + description: The active status of the ticket trigger (true or false) + category_id: + type: string + description: The ID of the new category the ticket trigger is to be moved to + id: + type: integer + description: The ID of the ticket trigger to update + position: + type: integer + description: The new position of the ticket trigger + example: + active: true + category_id: "10026" + id: 25 + position: 8 + required: + - id + TriggerBulkUpdateRequest: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/TriggerBulkUpdateItem' + TriggerCategoriesResponse: + type: object + properties: + trigger_categories: + type: array + items: + type: object + anyOf: + - $ref: '#/components/schemas/TriggerCategoryRuleCounts' + allOf: + - $ref: '#/components/schemas/TriggerCategory' + TriggerCategory: + type: object + properties: + created_at: + type: string + readOnly: true + id: + type: string + readOnly: true + name: + type: string + position: + type: integer + format: int64 + updated_at: + type: string + readOnly: true + TriggerCategoryBatchRequest: + type: object + properties: + id: + type: string + position: + type: integer + format: int64 + required: + - id + - position + TriggerCategoryId: + type: string + TriggerCategoryRequest: + type: object + properties: + name: + type: string + position: + type: integer + format: int64 + TriggerCategoryRequestRequired: + type: object + required: + - name + TriggerCategoryResponse: + type: object + properties: + trigger_category: + $ref: '#/components/schemas/TriggerCategory' + TriggerCategoryRuleCounts: + type: object + properties: + active_count: + type: integer + format: int64 + inactive_count: + type: integer + format: int64 + TriggerChangeObject: + type: object + properties: + change: + type: string + description: One of `-`, `+`, `=` representing the type of change + content: + description: The value of the item it represents + oneOf: + - type: boolean + - type: string + - type: integer + - type: array + items: + oneOf: + - type: string + - type: integer + - type: boolean + example: + change: + + content: solved + TriggerConditionDefinitionObjectAll: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + values: + type: array + items: + type: object + properties: + enabled: + type: boolean + title: + type: string + value: + type: string + TriggerConditionDefinitionObjectAny: + type: object + properties: + group: + type: string + nullable: + type: boolean + operators: + type: array + items: + type: object + properties: + terminal: + type: boolean + title: + type: string + value: + type: string + repeatable: + type: boolean + subject: + type: string + title: + type: string + type: + type: string + TriggerConditionDiffObject: + type: object + properties: + field: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + operator: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + value: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + example: + field: + - change: = + content: status + operator: + - change: = + content: less_than + value: + - change: + + content: solved + TriggerConditionObject: + type: object + properties: + field: + type: string + operator: + type: string + value: + oneOf: + - type: string + - type: integer + - type: array + items: + oneOf: + - type: string + - type: integer + example: + field: status + operator: less_than + value: solved + TriggerConditionsDiffObject: + type: object + properties: + all: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDiffObject' + nullable: true + any: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDiffObject' + nullable: true + TriggerConditionsObject: + type: object + description: An object that describes the circumstances under which the trigger performs its actions. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + properties: + all: + type: array + items: + $ref: '#/components/schemas/TriggerConditionObject' + nullable: true + any: + type: array + items: + $ref: '#/components/schemas/TriggerConditionObject' + nullable: true + example: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + - field: custom_status_id + operator: includes + value: + - "1" + - "2" + any: + - field: status + operator: less_than + value: solved + - field: custom_status_id + operator: includes + value: + - "1" + - "2" + TriggerDefinitionObject: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/TriggerActionDefinitionObject' + conditions_all: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDefinitionObjectAll' + conditions_any: + type: array + items: + $ref: '#/components/schemas/TriggerConditionDefinitionObjectAny' + TriggerDefinitionResponse: + type: object + properties: + definitions: + $ref: '#/components/schemas/TriggerDefinitionObject' + TriggerObject: + type: object + properties: + actions: + type: array + description: An array of actions describing what the ticket trigger will do. See [Actions reference](/documentation/ticketing/reference-guides/actions-reference) + items: + $ref: '#/components/schemas/TriggerActionObject' + active: + type: boolean + description: Whether the ticket trigger is active + all: + type: array + description: Legacy format for conditions (deprecated). Use conditions.all instead + items: + $ref: '#/components/schemas/TriggerConditionObject' + any: + type: array + description: Legacy format for conditions (deprecated). Use conditions.any instead + items: + $ref: '#/components/schemas/TriggerConditionObject' + brand_id: + type: integer + description: The ID of the brand the ticket trigger belongs to + category: + type: object + description: A category to create and assign to the trigger + properties: + name: + type: string + position: + type: integer + writeOnly: true + category_id: + type: string + description: The ID of the category the ticket trigger belongs to + nullable: true + conditions: + $ref: '#/components/schemas/TriggerConditionsObject' + created_at: + type: string + description: The time the ticket trigger was created + readOnly: true + default: + type: boolean + description: If true, the ticket trigger is a standard trigger + readOnly: true + description: + type: string + description: The description of the ticket trigger + id: + type: integer + description: Automatically assigned when created + readOnly: true + position: + type: integer + description: Position of the ticket trigger, determines the order they will execute in + raw_title: + type: string + description: The raw format of the title of the ticket trigger + restriction: + type: object + description: Access restriction for this trigger. A null value allows unrestricted access + additionalProperties: true + nullable: true + title: + type: string + description: The title of the ticket trigger + updated_at: + type: string + description: The time of the last update of the ticket trigger + readOnly: true + url: + type: string + description: The url of the ticket trigger + readOnly: true + example: + actions: + - { } + active: true + category_id: "10026" + conditions: { } + created_at: "2012-09-25T22:50:26Z" + default: false + description: Close and save a ticket + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/25 + required: + - actions + - title + TriggerResponse: + type: object + properties: + trigger: + $ref: '#/components/schemas/TriggerObject' + TriggerRevisionResponse: + type: object + properties: + trigger_revision: + type: object + properties: + author_id: + type: integer + created_at: + type: string + id: + type: integer + snapshot: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/TriggerActionObject' + active: + type: boolean + conditions: + $ref: '#/components/schemas/TriggerConditionsObject' + description: + type: string + nullable: true + title: + type: string + url: + type: string + TriggerRevisionsResponse: + type: object + properties: + after_cursor: + type: string + after_url: + type: string + before_cursor: + type: string + before_url: + type: string + count: + type: integer + trigger_revisions: + type: array + items: + type: object + properties: + author_id: + type: integer + created_at: + type: string + diff: + type: object + properties: + actions: + type: array + description: An array that contain [action diff objects](#Action Diffs) + items: + $ref: '#/components/schemas/TriggerActionDiffObject' + active: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + conditions: + $ref: '#/components/schemas/TriggerConditionDiffObject' + description: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + source_id: + type: integer + description: ID of the source revision + target_id: + type: integer + description: ID of the target revision + title: + type: array + description: An array of [change](#change) objects + items: + $ref: '#/components/schemas/TriggerChangeObject' + id: + type: integer + snapshot: + $ref: '#/components/schemas/TriggerSnapshotObject' + url: + type: string + TriggerSnapshotObject: + type: object + properties: + actions: + type: array + description: An array of [Actions](#actions) describing what the ticket trigger will do + items: + $ref: '#/components/schemas/TriggerActionObject' + active: + type: boolean + description: Whether the ticket trigger is active + conditions: + $ref: '#/components/schemas/TriggerConditionsObject' + description: + type: string + description: The description of the ticket trigger + nullable: true + title: + type: string + description: The title of the ticket trigger + example: + actions: [ ] + active: true + conditions: { } + description: Notifies requester that a comment was updated + title: Notify requester of comment update + TriggerWithCategoryRequest: + type: object + properties: + trigger: + $ref: '#/components/schemas/TriggerObject' + TriggersResponse: + type: object + properties: + count: + type: integer + next_page: + type: string + nullable: true + previous_page: + type: string + nullable: true + triggers: + type: array + items: + $ref: '#/components/schemas/TriggerObject' + TwitterChannelObject: + title: Monitored X handles + type: object + properties: + allow_reply: + type: boolean + description: If replies are allowed for this handle + readOnly: true + avatar_url: + type: string + description: The profile image url of the handle + readOnly: true + brand_id: + type: integer + description: What brand the handle is associated with + readOnly: true + can_reply: + type: boolean + description: If replies are allowed for this handle + readOnly: true + created_at: + type: string + format: date-time + description: The time the handle was created + readOnly: true + id: + type: integer + description: Automatically assigned upon creation + readOnly: true + name: + type: string + description: The profile name of the handle + readOnly: true + screen_name: + type: string + description: The X handle + readOnly: true + twitter_user_id: + type: integer + description: The country's code + readOnly: true + updated_at: + type: string + format: date-time + description: The time of the last update of the handle + readOnly: true + example: + created_at: "2009-05-13T00:07:08Z" + id: 211 + screen_name: '@zendesk' + twitter_user_id: 67462376832 + updated_at: "2011-07-22T00:11:12Z" + required: + - id + - screen_name + - twitter_user_id + TwitterChannelResponse: + type: object + properties: + monitored_twitter_handle: + $ref: '#/components/schemas/TwitterChannelObject' + TwitterChannelTwicketStatusResponse: + type: object + properties: + statuses: + type: array + items: + type: object + properties: + favorited: + type: boolean + id: + type: integer + retweeted: + type: boolean + user_followed: + type: boolean + TwitterChannelsResponse: + type: object + properties: + monitored_twitter_handles: + type: array + items: + $ref: '#/components/schemas/TwitterChannelObject' + UpdateResourceResult: + type: object + properties: + action: + type: string + description: | + the action the job attempted (`"action": "update"`) + id: + type: integer + description: the id of the resource the job attempted to update + status: + type: string + description: | + the status (`"status": "Updated"`) + success: + type: boolean + description: | + whether the action was successful or not (`"success": true`) + required: + - id + - action + - success + - status + UpdateTicketFormStatusesParams: + type: object + properties: + ticket_form_status: + type: array + items: + $ref: '#/components/schemas/TicketFormStatusesUpdateParams' + required: + - ticket_form_status + UrlObject: + type: object + properties: + url: + type: string + readOnly: true + UserCreateInput: + type: object + properties: + active_brand_id: + type: integer + description: The id of the brand to assign to the user + nullable: true + agent_brand_ids: + type: array + items: + type: integer + alias: + type: string + description: An alias displayed to end users + nullable: true + custom_role_id: + type: integer + description: A custom role if the user is an agent on the Enterprise plan or above + nullable: true + default_group_id: + type: integer + description: The id of the user's default group + nullable: true + details: + type: string + description: Any details you want to store about the user, such as an address + nullable: true + email: + type: string + external_id: + type: string + description: A unique identifier from another system + nullable: true + group_id: + type: integer + description: The id of the user's default group. Alias for default_group_id + nullable: true + group_ids: + type: array + description: The ids of the groups to assign to the user + items: + type: integer + identities: + type: array + items: + $ref: '#/components/schemas/UserIdentityInput' + language: + type: string + description: The user's language preference. Alias for locale. + nullable: true + locale: + type: string + description: The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used. + nullable: true + locale_id: + type: integer + description: The user's language identifier + nullable: true + moderator: + type: boolean + description: Designates whether the user has forum moderation capabilities + nullable: true + name: + type: string + notes: + type: string + description: Any notes you want to store about the user + nullable: true + only_private_comments: + type: boolean + description: true if the user can only create private comments + nullable: true + organization: + type: object + properties: + name: + type: string + required: + - name + organization_id: + type: integer + description: The id of the user's organization + nullable: true + organization_ids: + type: array + description: The ids of the user's organizations + items: + type: integer + nullable: true + organization_name: + type: string + description: The name of the user's organization (deprecated, use organization object instead) + deprecated: true + nullable: true + password: + type: string + description: The user's password + phone: + type: string + description: The user's primary phone number + nullable: true + remote_photo_url: + type: string + description: A URL pointing to the user's profile picture + nullable: true + role: + type: string + shared_phone_number: + type: boolean + description: Whether the phone number is shared or not + nullable: true + signature: + type: string + description: The user's signature. Only agents and admins can have signatures + nullable: true + skip_verify_email: + type: boolean + description: If true, the user won't receive a verification email + nullable: true + suspended: + type: boolean + description: If the user is suspended + nullable: true + tags: + type: array + description: The user's tags + items: + type: string + nullable: true + ticket_restriction: + type: string + description: Specifies which tickets the user has access to + nullable: true + time_zone: + type: string + description: The user's time zone + nullable: true + user_fields: + type: object + description: Values of custom fields in the user's profile + additionalProperties: true + nullable: true + verified: + type: boolean + description: Any of the user's identities is verified + nullable: true + required: + - name + UserEntitlementObject: + type: object + properties: + is_active: + type: boolean + description: Whether the entitlement is active for the product + example: true + name: + type: string + description: The role name for the product entitlement + example: admin + UserEntitlementsFullResponse: + type: object + properties: + entitlements: + type: object + description: Entitlements for Zendesk products (Live Chat, Explore, Voice, Knowledge) + properties: + chat: + $ref: '#/components/schemas/UserEntitlementObject' + explore: + $ref: '#/components/schemas/UserEntitlementObject' + guide: + $ref: '#/components/schemas/UserEntitlementObject' + talk: + $ref: '#/components/schemas/UserEntitlementObject' + UserFieldObject: + type: object + allOf: + - $ref: '#/components/schemas/CustomFieldObject' + - type: object + properties: + relationship_target_type: + type: string + description: A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", and "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment". + example: + active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/user_fields/7 + UserFieldResponse: + type: object + properties: + user_field: + $ref: '#/components/schemas/UserFieldObject' + UserFieldsResponse: + type: object + properties: + count: + type: integer + description: Total count of records retrieved + readOnly: true + next_page: + type: string + description: URL of the next page + nullable: true + readOnly: true + previous_page: + type: string + description: URL of the previous page + nullable: true + readOnly: true + user_fields: + type: array + items: + $ref: '#/components/schemas/UserFieldObject' + UserForAdmin: + title: Users + type: object + properties: + active: + type: boolean + description: false if the user has been deleted + readOnly: true + agent_brand_ids: + type: array + description: PUT or POST requests only. Assigns agent or agents to a brand. For more information, see [Agent brand ids](#agent-brand-ids) + items: + type: integer + alias: + type: string + description: An alias displayed to end users + chat_only: + type: boolean + description: Whether or not the user is a chat-only agent + readOnly: true + created_at: + type: string + format: date-time + description: The time the user was created + readOnly: true + custom_role_id: + type: integer + description: A custom role if the user is an agent on the Enterprise plan or above + nullable: true + default_group_id: + type: integer + description: The id of the user's default group + details: + type: string + description: Any details you want to store about the user, such as an address + email: + type: string + description: The user's primary email address. *Writeable on create only. On update, a secondary email is added. See [Email Address](#email-address) + external_id: + type: string + description: 'A unique identifier from another system. The API treats the id as case insensitive. Example: "ian1" and "IAN1" are the same value.' + nullable: true + iana_time_zone: + type: string + description: The time zone for the user + readOnly: true + id: + type: integer + description: Automatically assigned when the user is created + readOnly: true + last_login_at: + type: string + format: date-time + description: | + Last time the user signed in to Zendesk Support or made an API request + using an API token + readOnly: true + locale: + type: string + description: The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used. + locale_id: + type: integer + description: The user's language identifier + moderator: + type: boolean + description: Designates whether the user has forum moderation capabilities + name: + type: string + description: The user's name + notes: + type: string + description: Any notes you want to store about the user + only_private_comments: + type: boolean + description: true if the user can only create private comments + organization_id: + type: integer + description: The id of the user's organization. If the user has more than one [organization memberships](/api-reference/ticketing/organizations/organization_memberships/), the id of the user's default organization. If updating, see [Organization ID](#organization-id) + nullable: true + phone: + type: string + description: The user's primary phone number. See [Phone Number](#phone-number) below + nullable: true + photo: + type: object + description: The user's profile picture represented as an [Attachment](/api-reference/ticketing/tickets/ticket-attachments/) object + additionalProperties: true + nullable: true + remote_photo_url: + type: string + description: A URL pointing to the user's profile picture. + report_csv: + type: boolean + description: | + This parameter is inert and has no effect. It may be deprecated in the + future. + + Previously, this parameter determined whether a user could access a CSV + report in a legacy Guide dashboard. This dashboard has been removed. See + [Announcing Guide legacy reporting upgrade to + Explore](https://support.zendesk.com/hc/en-us/articles/4762263171610-Announcing-Guide-legacy-reporting-upgrade-to-Explore-) + readOnly: true + restricted_agent: + type: boolean + description: If the agent has any restrictions; false for admins and unrestricted agents, true for other agents + readOnly: true + role: + type: string + description: The user's role. Possible values are "end-user", "agent", or "admin" + role_type: + type: integer + description: The user's role id. 0 for a custom agent, 1 for a light agent, 2 for a chat agent, 3 for a chat agent added to the Support account as a contributor ([Chat Phase 4](https://support.zendesk.com/hc/en-us/articles/360022365373#topic_djh_1zk_4fb)), 4 for an admin, and 5 for a billing admin + nullable: true + readOnly: true + shared: + type: boolean + description: If the user is shared from a different Zendesk Support instance. Shared users can be added to organizations but cannot be modified through update requests. Any attempt to update a shared user results in a 403 Forbidden error. Ticket sharing accounts only + readOnly: true + shared_agent: + type: boolean + description: If the user is a shared agent from a different Zendesk Support instance. Ticket sharing accounts only + readOnly: true + shared_phone_number: + type: boolean + description: Whether the `phone` number is shared or not. See [Phone Number](#phone-number) below + nullable: true + signature: + type: string + description: The user's signature. Only agents and admins can have signatures + suspended: + type: boolean + description: If the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal + tags: + type: array + description: The user's tags. Only present if your account has user tagging enabled + items: + type: string + ticket_restriction: + type: string + description: 'Specifies which tickets the user has access to. Possible values are: "organization", "groups", "assigned", "requested", null. "groups" and "assigned" are valid only for agents. If you pass an invalid value to an end user (for example, "groups"), they will be assigned to "requested", regardless of their previous access' + nullable: true + time_zone: + type: string + description: The user's time zone. See [Time Zone](#time-zone) + two_factor_auth_enabled: + type: boolean + description: If two factor authentication is enabled + nullable: true + readOnly: true + updated_at: + type: string + format: date-time + description: The time the user was last updated + readOnly: true + url: + type: string + description: The user's API url + readOnly: true + user_fields: + type: object + description: Values of custom fields in the user's profile. See [User Fields](#user-fields) + additionalProperties: true + verified: + type: boolean + description: Any of the user's identities is verified. See [User Identities](/api-reference/ticketing/users/user_identities) + example: + active: true + alias: Mr. Johnny + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + iana_time_zone: Pacific/Pago_Pago + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + required: + - name + UserForEndUser: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the user was created + readOnly: true + email: + type: string + description: The primary email address of this user. If the primary email address is not [verified](https://support.zendesk.com/hc/en-us/articles/4408886752410), the secondary email address is used + iana_time_zone: + type: string + description: The time zone for the user + readOnly: true + id: + type: integer + description: Automatically assigned when creating users + readOnly: true + locale: + type: string + description: The locale for this user + readOnly: true + locale_id: + type: integer + description: The language identifier for this user + name: + type: string + description: The name of the user + organization_id: + type: integer + description: The id of the user's organization. If the user has more than one [organization memberships](/api-reference/ticketing/organizations/organization_memberships/), the id of the user's default organization. If updating, see [Organization ID](/api-reference/ticketing/users/users/#organization-id) + phone: + type: string + description: The primary phone number of this user. See [Phone Number](/api-reference/ticketing/users/users/#phone-number) in the Users API + photo: + type: object + description: The user's profile picture represented as an [Attachment](/api-reference/ticketing/tickets/ticket-attachments/) object + additionalProperties: true + role: + type: string + description: 'The role of the user. Possible values: `"end-user"`, `"agent"`, `"admin"`' + shared_phone_number: + type: boolean + description: Whether the `phone` number is shared or not. See [Phone Number](/api-reference/ticketing/users/users/#phone-number) in the Users API + time_zone: + type: string + description: The time-zone of this user + updated_at: + type: string + format: date-time + description: The time of the last update of the user + readOnly: true + url: + type: string + description: The API url of this user + readOnly: true + verified: + type: boolean + description: Any of the user's identities is verified. See [User Identities](/api-reference/ticketing/users/user_identities) + required: + - name + UserIdentitiesResponse: + type: object + properties: + identities: + type: array + items: + $ref: '#/components/schemas/UserIdentityObject' + UserIdentityInput: + type: object + properties: + primary: + type: boolean + description: If the identity is the primary identity. Writable only when creating, not when updating. + type: + type: string + enum: + - email + - twitter + - facebook + - google + - phone_number + - agent_forwarding + - any_channel + - foreign + - sdk + - messaging + value: + type: string + verification_method: + type: string + description: Indicates the state of user identity verification. + enum: + - none + - low + - sso + - embed + - full + verified: + type: boolean + description: If the identity has been verified. Deprecated. Use `verification_method` as a more accurate representation of a user's state of verification. + deprecated: true + required: + - type + - value + UserIdentityObject: + type: object + properties: + created_at: + type: string + format: date-time + description: The time the identity was created + readOnly: true + deliverable_state: + type: string + description: Email identity type only. Indicates if Zendesk sends notifications to the email address. See [Deliverable state](#deliverable-state) + readOnly: true + id: + type: integer + description: Automatically assigned on creation + readOnly: true + primary: + type: boolean + description: If the identity is the primary identity. *Writable only when creating, not when updating. Use the [Make Identity Primary](#make-identity-primary) endpoint instead + type: + type: string + description: The type of this identity + enum: + - email + - twitter + - facebook + - google + - phone_number + - agent_forwarding + - any_channel + - foreign + - sdk + - messaging + readOnly: true + undeliverable_count: + type: integer + description: The number of times a soft-bounce response was received at that address + readOnly: true + updated_at: + type: string + format: date-time + description: The time the identity was updated + readOnly: true + url: + type: string + description: The API url of this identity + readOnly: true + user_id: + type: integer + description: The id of the user + readOnly: true + value: + type: string + description: The identifier for this identity, such as an email address + readOnly: true + verification_method: + type: string + description: Indicates the state of user identity verification. See [Verification method](#verification-method). + enum: + - none + - low + - sso + - embed + - full + verified: + type: boolean + description: If the identity has been verified. Deprecated. Use `verification_method` as a more accurate representation of a user's state of verification. + deprecated: true + verified_at: + type: string + format: date-time + description: The last time a full verification flow was completed for the identity + nullable: true + readOnly: true + example: + created_at: "2011-07-20T22:55:29Z" + deliverable_state: deliverable + id: 35436 + primary: true + type: email + updated_at: "2011-07-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/users/135/identities/35436 + user_id: 135 + value: someone@example.com + verification_method: full + verified: true + verified_at: "2011-07-20T22:55:29Z" + required: + - user_id + - type + - value + UserIdentityResponse: + type: object + properties: + identity: + $ref: '#/components/schemas/UserIdentityObject' + UserInput: + anyOf: + - $ref: '#/components/schemas/UserCreateInput' + - $ref: '#/components/schemas/UserMergeInput' + additionalProperties: true + UserMergeInput: + type: object + description: | + Variant for create_or_update when identifying an existing user by id, + email, or external_id. No fields are strictly required since the caller + may use any of these identifiers. + properties: + active_brand_id: + type: integer + nullable: true + agent_brand_ids: + type: array + items: + type: integer + alias: + type: string + nullable: true + custom_role_id: + type: integer + nullable: true + default_group_id: + type: integer + nullable: true + details: + type: string + nullable: true + email: + type: string + external_id: + type: string + nullable: true + group_id: + type: integer + nullable: true + group_ids: + type: array + items: + type: integer + id: + type: integer + description: The user's id + identities: + type: array + items: + $ref: '#/components/schemas/UserIdentityInput' + language: + type: string + nullable: true + locale: + type: string + nullable: true + locale_id: + type: integer + nullable: true + moderator: + type: boolean + nullable: true + name: + type: string + notes: + type: string + nullable: true + only_private_comments: + type: boolean + nullable: true + organization: + type: object + properties: + name: + type: string + required: + - name + organization_id: + type: integer + nullable: true + organization_ids: + type: array + items: + type: integer + nullable: true + organization_name: + type: string + deprecated: true + nullable: true + password: + type: string + description: The user's password + phone: + type: string + nullable: true + remote_photo_url: + type: string + nullable: true + role: + type: string + shared_phone_number: + type: boolean + nullable: true + signature: + type: string + nullable: true + skip_verify_email: + type: boolean + nullable: true + suspended: + type: boolean + nullable: true + tags: + type: array + items: + type: string + nullable: true + ticket_restriction: + type: string + nullable: true + time_zone: + type: string + nullable: true + user_fields: + type: object + description: Values of custom fields in the user's profile + additionalProperties: true + nullable: true + verified: + type: boolean + nullable: true + UserObject: + anyOf: + - $ref: '#/components/schemas/UserForAdmin' + - $ref: '#/components/schemas/UserForEndUser' + additionalProperties: true + UserPasswordRequirementsResponse: + type: object + properties: + requirements: + type: array + items: + type: string + UserRelatedObject: + type: object + properties: + assigned_tickets: + type: integer + description: Count of assigned tickets + ccd_tickets: + type: integer + description: Count of collaborated tickets + organization_subscriptions: + type: integer + description: Count of organization subscriptions + requested_tickets: + type: integer + description: Count of requested tickets + UserRelatedResponse: + type: object + properties: + user_related: + $ref: '#/components/schemas/UserRelatedObject' + UserRequest: + type: object + properties: + user: + $ref: '#/components/schemas/UserInput' + required: + - user + UserResponse: + type: object + properties: + user: + $ref: '#/components/schemas/UserObject' + UserSettingsResponse: + type: object + properties: + settings: + type: object + description: User settings + properties: + admin_center: + type: object + description: Admin Center UI settings + properties: + has_admin_center_side_nav_open: + type: boolean + additionalProperties: true + lotus: + type: object + description: Lotus UI settings for onboarding, tooltips, and feature preferences + properties: + agent_workspace_theme_preference: + type: string + description: Agent workspace theme preference (0=light, 1=dark, 2=system) + enum: + - "0" + - "1" + - "2" + agent_workspace_theme_preference_for_conversation_panel: + type: string + description: Theme preference for conversation panel (0=light, 1=dark, 2=system) + enum: + - "0" + - "1" + - "2" + keyboard_shortcuts_enabled: + type: boolean + macro_shortcuts_enabled: + type: boolean + show_onboarding_tooltips: + type: boolean + two_factor_authentication: + type: boolean + description: Whether user is eligible for 2FA + additionalProperties: true + shared_views_order: + type: array + description: Order of shared views (array of view IDs) + items: + type: integer + nullable: true + UserSettingsUpdateRequest: + type: object + properties: + settings: + type: object + description: User settings to update + properties: + admin_center: + type: object + description: Admin Center UI settings for onboarding and preferences + properties: + has_admin_center_side_nav_open: + type: boolean + description: Whether the Admin Center side navigation is open + additionalProperties: true + lotus: + type: object + description: Lotus UI settings for onboarding, tooltips, and feature preferences + properties: + agent_workspace_theme_preference: + type: string + description: Agent workspace theme preference (0=light, 1=dark, 2=system) + enum: + - "0" + - "1" + - "2" + agent_workspace_theme_preference_for_conversation_panel: + type: string + description: Theme preference for conversation panel (0=light, 1=dark, 2=system) + enum: + - "0" + - "1" + - "2" + keyboard_shortcuts_enabled: + type: boolean + description: Enable keyboard shortcuts in Lotus + macro_shortcuts_enabled: + type: boolean + description: Enable macro shortcuts in Lotus + show_onboarding_tooltips: + type: boolean + description: Show tooltips for first-time user + additionalProperties: true + shared_views_order: + type: array + description: Order of shared views (array of view IDs) + items: + type: integer + nullable: true + required: + - settings + UserUpdateInput: + type: object + description: | + Input schema for updating a user. All fields are optional - only include + the fields you want to update. + properties: + agent_brand_ids: + type: array + description: The IDs of the brands the agent is assigned to + items: + type: integer + nullable: true + alias: + type: string + description: An alias displayed to end users + nullable: true + custom_role_id: + type: integer + description: A custom role if the user is an agent on the Enterprise plan or above + nullable: true + default_group_id: + type: integer + description: The id of the user's default group + nullable: true + details: + type: string + description: Any details you want to store about the user, such as an address + nullable: true + email: + type: string + description: The user's primary email address + external_id: + type: string + description: A unique identifier from another system + nullable: true + group_id: + type: integer + description: The id of the user's default group. Alias for default_group_id + nullable: true + identities: + type: array + items: + $ref: '#/components/schemas/UserIdentityInput' + language: + type: string + description: The user's language preference. Alias for locale. + nullable: true + locale: + type: string + description: The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used. + nullable: true + locale_id: + type: integer + description: The user's language identifier + nullable: true + moderator: + type: boolean + description: Designates whether the user has forum moderation capabilities + nullable: true + name: + type: string + description: The user's name + notes: + type: string + description: Any notes you want to store about the user + nullable: true + only_private_comments: + type: boolean + description: true if the user can only create private comments + nullable: true + organization_id: + type: integer + description: The id of the user's organization + nullable: true + organization_ids: + type: array + description: The ids of the user's organizations + items: + type: integer + nullable: true + phone: + type: string + description: The user's primary phone number + nullable: true + photo: + type: object + description: The user's profile picture + additionalProperties: true + nullable: true + remote_photo_url: + type: string + description: A URL pointing to the user's profile picture + nullable: true + role: + type: string + description: The user's role + shared_phone_number: + type: boolean + description: Whether the phone number is shared or not + nullable: true + signature: + type: string + description: The user's signature. Only agents and admins can have signatures + nullable: true + skip_verify_email: + type: boolean + description: If true, the user won't receive a verification email + nullable: true + suspended: + type: boolean + description: If the user is suspended + nullable: true + tags: + type: array + description: The user's tags + items: + type: string + nullable: true + ticket_restriction: + type: string + description: Specifies which tickets the user has access to + nullable: true + time_zone: + type: string + description: The user's time zone + nullable: true + user_fields: + type: object + description: Values of custom fields in the user's profile + additionalProperties: true + nullable: true + verified: + type: boolean + description: Any of the user's identities is verified + nullable: true + UserUpdateRequest: + type: object + properties: + user: + $ref: '#/components/schemas/UserUpdateInput' + required: + - user + UsersRequest: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/UserInput' + required: + - users + UsersResponse: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/UserObject' + ViaObject: + type: object + description: | + An object explaining how the ticket was created. See the [Via object reference](/documentation/ticketing/reference-guides/via-object-reference) + properties: + channel: + description: | + This tells you how the ticket or event was created. Examples: "web", "mobile", "rule", "system". + May be a string name or an integer channel ID. + oneOf: + - type: string + - type: integer + source: + type: object + description: | + For some channels a source object gives more information about how or why the ticket or event was created + properties: + from: + type: object + properties: + address: + type: string + nullable: true + id: + type: integer + nullable: true + name: + type: string + nullable: true + title: + type: string + nullable: true + rel: + type: string + nullable: true + to: + type: object + properties: + address: + type: string + name: + type: string + additionalProperties: true + example: + channel: rule + source: + from: + id: 22472716 + title: Assign to first responder + rel: trigger + to: { } + readOnly: true + ViewCategoriesResponse: + type: object + properties: + view_categories: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/ViewCategory' + ViewCategory: + type: object + properties: + created_at: + type: string + description: The time the view category was created + readOnly: true + id: + type: string + description: Automatically assigned when a view category is created + readOnly: true + name: + type: string + description: The name of the view category + parent_id: + type: string + description: The id of the parent category + nullable: true + position: + type: integer + format: int64 + description: Position of the view category. Determines the order in which it will be displayed + updated_at: + type: string + description: The time of the last update of the view category + readOnly: true + url: + type: string + description: The url of the view category + readOnly: true + ViewCategoryError: + type: object + properties: + code: + type: string + detail: + type: string + id: + type: string + links: + type: object + source: + type: object + status: + type: string + title: + type: string + required: + - code + - title + ViewCategoryErrors: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/ViewCategoryError' + ViewCategoryRequest: + type: object + properties: + name: + type: string + parent_id: + type: string + nullable: true + ViewCategoryRequestRequired: + type: object + required: + - name + ViewCategoryResponse: + type: object + properties: + view_category: + $ref: '#/components/schemas/ViewCategory' + ViewCountObject: + type: object + properties: + active: + type: boolean + description: Only active views if true, inactive views if false, all views if null. + readOnly: true + fresh: + type: boolean + description: false if the cached data is stale and the system is still loading and caching new data + readOnly: true + pretty: + type: string + description: A pretty-printed text approximation of the view count + readOnly: true + url: + type: string + description: The API url of the count + readOnly: true + value: + type: integer + description: The cached number of tickets in the view. Can also be null if the system is loading and caching new data. Not to be confused with 0 tickets + nullable: true + readOnly: true + view_id: + type: integer + description: The id of the view + readOnly: true + ViewCountResponse: + type: object + properties: + view_count: + $ref: '#/components/schemas/ViewCountObject' + ViewCountsResponse: + type: object + properties: + view_counts: + type: array + items: + $ref: '#/components/schemas/ViewCountObject' + ViewExportResponse: + type: object + properties: + export: + type: object + properties: + status: + type: string + readOnly: true + view_id: + type: integer + readOnly: true + ViewObject: + type: object + properties: + active: + type: boolean + description: Whether the view is active + conditions: + type: object + description: Describes how the view is constructed. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference) + additionalProperties: true + created_at: + type: string + format: date-time + description: The time the view was created + readOnly: true + default: + type: boolean + description: If true, the view is a default view + readOnly: true + description: + type: string + description: The description of the view + execution: + type: object + description: Describes how the view should be executed. See [Execution](#execution) + additionalProperties: true + id: + type: integer + description: Automatically assigned when created + readOnly: true + position: + type: integer + description: The position of the view + restriction: + type: object + description: Who may access this view. Is null when everyone in the account can access it + additionalProperties: true + title: + type: string + description: The title of the view + updated_at: + type: string + format: date-time + description: The time the view was last updated + readOnly: true + example: + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: [ ] + default: false + description: View for recent tickets + execution: + columns: + - id: status + title: Status + - id: updated + title: Updated + - id: 5 + title: Account + type: text + url: https://example.zendesk.com/api/v2/ticket_fields/5 + group: + id: status + order: desc + title: Status + sort: + id: updated + order: desc + title: Updated + id: 25 + position: 8 + restriction: + id: 4 + type: User + title: Tickets updated <12 Hours + ViewResponse: + type: object + properties: + columns: + type: array + items: + type: object + additionalProperties: true + groups: + type: array + items: + type: object + additionalProperties: true + rows: + type: array + items: + type: object + additionalProperties: true + view: + $ref: '#/components/schemas/ViewObject' + ViewsCountResponse: + type: object + properties: + count: + type: object + properties: + refreshed_at: + type: string + format: date-time + value: + type: integer + ViewsResponse: + type: object + properties: + count: + type: integer + readOnly: true + next_page: + type: string + nullable: true + readOnly: true + previous_page: + type: string + nullable: true + readOnly: true + views: + type: array + items: + $ref: '#/components/schemas/ViewObject' + WorkspaceInput: + type: object + properties: + conditions: + $ref: '#/components/schemas/ConditionsObject' + description: + type: string + description: User-defined description of this workspace's purpose + macros: + type: array + items: + type: number + ticket_form_id: + type: number + title: + type: string + description: The title of the workspace + WorkspaceObject: + type: object + properties: + activated: + type: boolean + description: If true, this workspace is available for use + apps: + type: array + description: The apps associated to this workspace + items: + type: object + additionalProperties: true + conditions: + $ref: '#/components/schemas/ConditionsObject' + created_at: + type: string + format: date-time + description: The time the workspace was created + description: + type: string + description: User-defined description of this workspace's purpose + id: + type: integer + description: Automatically assigned upon creation + macro_ids: + type: array + description: The ids of the macros associated to this workspace + items: + type: integer + macros: + type: array + description: The ids of the macros associated to this workspace + items: + type: integer + position: + type: integer + description: Ordering of the workspace relative to other workspaces + prefer_workspace_app_order: + type: boolean + description: If true, the order of apps within the workspace will be preserved + selected_macros: + type: array + description: An array of the macro objects that will be used in this workspace. See [Macros](/api-reference/ticketing/business-rules/macros/) + items: + $ref: '#/components/schemas/MacroObject' + ticket_form_id: + type: integer + description: The id of the ticket web form associated to this workspace + title: + type: string + description: The title of the workspace + updated_at: + type: string + format: date-time + description: The time of the last update of the workspace + url: + type: string + description: The URL for this resource + WorkspaceResponse: + type: object + allOf: + - type: object + properties: + workspaces: + type: array + items: + $ref: '#/components/schemas/WorkspaceObject' + - $ref: '#/components/schemas/OffsetPaginationObject' + parameters: + ActivityId: + name: activity_id + in: path + description: The activity ID + required: true + schema: + type: integer + example: 29183462 + ActivitySince: + name: since + in: query + description: A UTC time in ISO 8601 format to return ticket activities since said date. + schema: + type: string + example: "2013-04-03T16:02:46Z" + AgentId: + name: agent_id + in: path + description: ID of an agent + required: true + schema: + type: integer + examples: + default: + value: 385473779372 + ArchiveImmediately: + name: archive_immediately + in: query + description: If `true`, any ticket created with a `closed` status bypasses the normal ticket lifecycle and will be created directly in your ticket archive + schema: + type: boolean + AssigneeFieldSearchValue: + name: name + in: query + description: Query string used to search assignable groups & agents in the AssigneeField + required: true + schema: + type: string + example: Johnny Agent + AttachmentId: + name: attachment_id + in: path + description: The ID of the attachment + required: true + schema: + type: integer + example: 498483 + AuditLogId: + name: audit_log_id + in: path + description: The ID of the audit log + required: true + schema: + type: integer + example: 498483 + AutomationActive: + name: active + in: query + description: Filter by active automations if true or inactive automations if false + schema: + type: boolean + example: true + AutomationId: + name: automation_id + in: path + description: The ID of the automation + required: true + schema: + type: integer + example: 25 + AutomationInclude: + name: include + in: query + description: A sideload to include in the response. See [Sideloads](#sideloads-2) + schema: + type: string + example: usage_24h + AutomationSearchQuery: + name: query + in: query + description: Query string used to find all automations with matching title + required: true + schema: + type: string + example: close + AutomationSortBy: + name: sort_by + in: query + description: Possible values are "alphabetical", "created_at", "updated_at", and "position". If unspecified, the automations are sorted by relevance + schema: + type: string + example: position + AutomationSortOrder: + name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + example: desc + BookmarkId: + name: bookmark_id + in: path + description: The ID of the bookmark + required: true + schema: + type: integer + example: 900000001111 + BrandAgentId: + name: brand_agent_id + in: path + description: The id of the brand agent + required: true + schema: + type: string + example: 123ABC + BrandId: + name: brand_id + in: path + description: The ID of the brand + required: true + schema: + type: integer + example: 360002783572 + CommentId: + name: comment_id + in: path + description: The ID of the comment + required: true + schema: + type: integer + example: 654321 + CommentIds: + name: comment_ids + in: query + description: Comma-separated list of comment ids. One of ids, comment_ids, or ticket_ids is required. + schema: + type: string + example: 8433348111741,8433544226045,8433702508413 + Creator: + name: creator + in: query + description: | + If true, displays the `creator_user_id` and `creator_app_name` properties. If the ticket field is created + by an app, `creator_app_name` is the name of the app and `creator_user_id` is `-1`. If the ticket field + is not created by an app, then `creator_app_name` is null + schema: + type: boolean + CursorPaginationPage: + name: page + in: query + description: | + Cursor-based pagination parameters (JSON:API style). + + Supports nested parameters: + - `page[size]` - Number of records per page (default varies by endpoint, typically 100) + - `page[after]` - Cursor token to fetch records after this position + - `page[before]` - Cursor token to fetch records before this position + + Example: `?page[size]=50&page[after]=eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9` + style: deepObject + explode: true + schema: + type: object + properties: + after: + type: string + description: Cursor token for fetching next page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + before: + type: string + description: Cursor token for fetching previous page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + size: + type: integer + description: Number of records per page + example: 100 + minimum: 1 + CursorPaginationSort: + name: sort + in: query + description: | + Field to sort results by. Prefix with `-` for descending order. + + When used with cursor pagination, this determines the cursor ordering. + + Example: `?sort=name` or `?sort=-created_at` + schema: + type: string + example: name + CustomObjectFieldKeyOrId: + name: custom_object_field_key_or_id + in: path + description: The key or id of a custom object field + required: true + schema: + type: string + example: make + CustomObjectKey: + name: custom_object_key + in: path + description: The key of a custom object + required: true + schema: + type: string + example: car + CustomObjectRecordAttachmentId: + name: id + in: path + description: The id of a custom object record attachment + required: true + schema: + type: string + example: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + CustomObjectRecordExternalId: + name: external_id + in: query + description: The external id of a custom object record + schema: + type: string + example: X90001 + CustomObjectRecordId: + name: custom_object_record_id + in: path + description: The id of a custom object record + required: true + schema: + type: string + example: 01GCSJW391QVSC80GYDH7E93Q6 + CustomObjectRecordIdParam: + name: record_id + in: path + description: The id of a custom object record + required: true + schema: + type: string + example: 01GCSJW391QVSC80GYDH7E93Q6 + CustomObjectRecordName: + name: name + in: query + description: The name of a custom object record + schema: + type: string + example: boat + CustomRoleId: + name: custom_role_id + in: path + description: The ID of the custom agent role + required: true + schema: + type: integer + example: 10127 + CustomStatusId: + name: custom_status_id + in: path + description: The id of the custom status + required: true + schema: + type: integer + example: 1234567 + DeletedUserId: + name: deleted_user_id + in: path + description: The ID of the deleted user + required: true + schema: + type: integer + example: 35436 + DeletionScheduleId: + name: deletion_schedule_id + in: path + description: The id of the deletion schedule + required: true + schema: + type: integer + example: 132828 + DualPaginationPage: + name: page + in: query + description: | + Pagination parameter. Supports both traditional offset and cursor-based pagination: + + - Traditional: `?page=2` (integer page number) + - Cursor: `?page[size]=50&page[after]=cursor` (deepObject with size, after, before) + + These are mutually exclusive - use one format or the other, not both. + style: deepObject + explode: true + schema: + oneOf: + - type: integer + description: Traditional offset pagination page number (non-negative integer) + example: 1 + - type: object + description: Cursor pagination parameters (JSON:API style) + properties: + after: + type: string + description: Cursor token for next page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + before: + type: string + description: Cursor token for previous page + example: eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 + size: + type: integer + description: Number of records per page + example: 50 + minimum: 1 + DynamicContentItemId: + name: dynamic_content_item_id + in: path + description: The ID of the dynamic content item + required: true + schema: + type: integer + example: 47 + DynamicContentVariantId: + name: dynamic_content_variant_id + in: path + description: The ID of the variant + required: true + schema: + type: integer + example: 23 + EmailNotificationsByTicketIds: + name: ticket_ids + in: query + description: Comma-separated list of ticket ids. One of ids, comment_ids, or ticket_ids is required. + schema: + type: string + example: 35436,35437 + EmailNotificationsFilter: + name: filter + in: query + description: | + Filters the email notifications by ticket, comment, or notification id. + style: deepObject + explode: true + required: true + schema: + type: object + properties: + comment_id: + type: integer + notification_id: + type: integer + ticket_id: + type: integer + examples: + byCommentId: + summary: Filter by comment id. + value: + comment_id: 782407 + byNotificationId: + summary: Filter by notification id. + value: + notification_id: 7824075373693 + byTicketId: + summary: Filter by ticket id. + value: + ticket_id: 623 + EssentialsCardKey: + name: object_type + in: path + description: | + Essentials card type. Example: `zen:user` refers user type + required: true + schema: + type: string + example: zen:user + ExcludeDeleted: + name: exclude_deleted + in: query + description: Whether to exclude deleted entities + schema: + type: boolean + example: false + ExcludeSideloads: + name: exclude + in: query + description: | + A comma-separated list of sideloads to exclude from the response. + schema: + type: string + ExcludeSubSelectionOptions: + name: exclude_sub_selection_options + in: query + description: Excludes `sub_selection_options` from option payloads to reduce response size. + schema: + type: boolean + example: true + FeatureIds: + name: ids + in: query + description: Comma-separated list of feature names to filter the response + schema: + type: string + example: polaris,agent_workspace + FeatureSubscription: + name: subscription + in: query + description: Filter features to only subscription-backed features + schema: + type: boolean + example: true + GlobalClientId: + name: global_client_id + in: path + description: The ID of the Global OAuth client + required: true + schema: + type: integer + example: 223443 + GlobalClientTokenSummaryIncludeExpiredTokensQuery: + name: include_expired + in: query + description: If true, includes expired tokens in summary + schema: + type: boolean + example: true + GroupId: + name: group_id + in: path + description: The ID of the group + required: true + schema: + type: integer + example: 122 + GroupMembershipId: + name: group_membership_id + in: path + description: The ID of the group membership + required: true + schema: + type: integer + example: 4 + GroupMembershipsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + Valid values: `users`, `groups`. + schema: + type: string + example: users,groups + GroupSLAPolicyId: + name: group_sla_policy_id + in: path + description: The id of the Group SLA policy + required: true + schema: + type: integer + example: 36 + GroupsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + schema: + type: string + example: users,group_settings + HostMapping: + name: host_mapping + in: query + description: The hostmapping to a brand, if any (only admins view this key) + required: true + schema: + type: string + example: brand1.com + IncludeBoundaryIndicators: + name: include_boundary_indicators + in: query + description: | + When true, includes `has_more` indicator in the cursor pagination response meta. + + Only valid with cursor pagination (page[size], page[after], page[before]). + schema: + type: boolean + IncludeItemCursors: + name: include_item_cursors + in: query + description: | + When true, includes cursor values for each item in the cursor pagination response. + + Only valid with cursor pagination (page[size], page[after], page[before]). + schema: + type: boolean + IncludeSideloads: + name: include + in: query + description: | + A comma-separated list of sideloads to include in the response. + schema: + type: string + IncludeStandardFields: + name: include_standard_fields + in: query + description: Include standard fields if true. Exclude them if false + schema: + type: boolean + example: true + IncrementalCursor: + name: cursor + in: query + description: The cursor pointer to work with for all subsequent exports after the initial request + schema: + type: string + IncrementalPage: + name: per_page + in: query + description: The number of records to return per page + schema: + type: integer + IncrementalResource: + name: incremental_resource + in: path + description: The resource requested for incremental sample export + required: true + schema: + type: string + example: tickets + IncrementalTicketEventsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + Supports `comment_events` to include full comment data in the response. + schema: + type: string + example: comment_events + IncrementalTimeQueryParameter: + name: unix_time + in: query + description: A query start time for incremental exports + schema: + type: integer + example: 1383685952 + IncrementalUnixTime: + name: start_time + in: query + description: The time to start the incremental export from. Must be at least one minute in the past. Data isn't provided for the most recent minute + required: true + schema: + type: integer + example: 1332034771 + ItamAssetId: + name: asset_id + in: path + description: The id of the asset + required: true + schema: + type: string + example: 01K9AMAPSER316NHTJ2R36YAQ1 + ItamAssetLocationId: + name: location_id + in: path + description: The id of the location + required: true + schema: + type: string + example: 01KBFXPX2QFYZSSC1TMF3Q6T68 + ItamAssetStatusId: + name: status_id + in: path + description: The id of the asset status + required: true + schema: + type: string + example: 01K9BT5XE82QS5DG58F4J8WQWY + ItamAssetTypeFieldId: + name: asset_type_field_id + in: path + description: The id of the asset field + required: true + schema: + type: string + example: 01K9AMB3T2PBD108PF71ZDK7Y5 + ItamAssetTypeId: + name: asset_type_id + in: path + description: The id of the asset type + required: true + schema: + type: string + example: 01K9AMAY0ST7VTVSG7SDAMR4P1 + JobStatusId: + name: job_status_id + in: path + description: the Id of the Job status + required: true + schema: + type: string + example: 8b726e606741012ffc2d782bcb7848fe + LocaleId: + name: locale_id + in: path + description: | + The ID or the [BCP-47 code](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale. Examples: es-419, en-us, pr-br + required: true + schema: + type: string + example: es-419 + LookupRelationshipAutocompleteFieldIdFragment: + name: field_id + in: query + description: | + The id of a lookup relationship field. The type of field is determined + by the `source` param + schema: + type: string + LookupRelationshipAutocompleteSourceFragment: + name: source + in: query + description: | + If a `field_id` is provided, this specifies the type of the field. + For example, if the field is on a "zen:user", it references a field on a user + schema: + type: string + examples: + organization: + summary: A reference to an organization + value: zen:organization + ticket: + summary: A reference to a ticket + value: zen:ticket + user: + summary: A reference to a user + value: zen:user + MacroAccess: + name: access + in: query + description: Filter macros by access. Possible values are "personal", "agents", "shared", or "account". The "agents" value returns all personal macros for the account's agents and is only available to admins. + schema: + type: string + example: personal + MacroActive: + name: active + in: query + description: Filter by active macros if true or inactive macros if false + schema: + type: boolean + example: true + MacroCategory: + name: category + in: query + description: Filter macros by category + schema: + type: integer + example: 25 + MacroGroupId: + name: group_id + in: query + description: Filter macros by group + schema: + type: integer + example: 25 + MacroId: + name: macro_id + in: path + description: The ID of the macro + required: true + schema: + type: integer + example: 25 + MacroIdQuery: + name: macro_id + in: query + description: The ID of the macro to replicate + required: true + schema: + type: integer + example: 25 + MacroInclude: + name: include + in: query + description: A sideload to include in the response. See [Sideloads](#sideloads-2) + schema: + type: string + example: usage_7d + MacroOnlyViewable: + name: only_viewable + in: query + description: If true, returns only macros that can be applied to tickets. If false, returns all macros the current user can manage. Default is false + schema: + type: boolean + example: false + MacroQuery: + name: query + in: query + description: Query string used to find macros with matching titles + required: true + schema: + type: string + example: close + MacroSearchSortBy: + name: sort_by + in: query + description: Possible values are "alphabetical", "created_at", "updated_at", or "position". Defaults to alphabetical + schema: + type: string + example: alphabetical + MacroSortBy: + name: sort_by + in: query + description: Possible values are "alphabetical", "created_at", "updated_at", "usage_1h", "usage_24h", "usage_7d", or "usage_30d". Defaults to alphabetical + schema: + type: string + example: alphabetical + MacroSortOrder: + name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + example: asc + MonitoredTwitterHandleId: + name: monitored_twitter_handle_id + in: path + description: The ID of the custom agent role + required: true + schema: + type: integer + example: 431 + NotificationId: + name: notification_id + in: path + description: The id of the email notification + required: true + schema: + type: integer + example: 7824075373693 + NotificationIds: + name: ids + in: query + description: Comma-separated list of notification ids. One of ids, comment_ids, or ticket_ids is required. + schema: + type: string + example: 8433702508541,8433348111869 + OAuthAllTokensQuery: + name: all + in: query + description: A boolean that returns all OAuth tokens in the account. Requires admin role + schema: + type: boolean + example: true + OAuthClientId: + name: oauth_client_id + in: path + description: The ID of the OAuth client + required: true + schema: + type: integer + example: 223443 + OAuthClientIdQuery: + name: client_id + in: query + description: The id of the OAuth client + schema: + type: integer + example: 223443 + OAuthGlobalClientIdQuery: + name: global_client_id + in: query + description: The id of the global OAuth client + schema: + type: integer + example: 334556 + OAuthIncludeExpiredTokensQuery: + name: include_expired + in: query + description: If true, returns all OAuth tokens in the account, including expired tokens. Must be used with the `all` query parameter + schema: + type: boolean + example: true + OAuthTokenId: + name: oauth_token_id + in: path + description: The ID of the OAuth token + required: true + schema: + type: integer + example: 223443 + ObjectKey: + name: object_zrn_type + in: path + description: | + Custom object type. Example: `zen:custom_object:car` refers to a custom object type with the + `car` key + required: true + schema: + type: string + example: zen:custom_object:car + OcrQueueId: + name: queue_id + in: path + description: The id of the omnichannel routing queue + required: true + schema: + type: string + example: 01HG80ATNNZK1N7XRFVKX48XD6 + OptionalIncrementalUnixTime: + name: start_time + in: query + description: The time to start the incremental export from. Must be at least one minute in the past. Data isn't provided for the most recent minute. Required on the initial export request; not required on subsequent cursor-based pagination requests + schema: + type: integer + example: 1332034771 + OrganizationExternalId: + name: external_id + in: query + description: The external id of an organization + schema: + type: integer + example: 1234 + OrganizationExternalIds: + name: external_ids + in: query + description: A list of external ids + schema: + type: string + example: 1764,42156 + OrganizationFieldId: + name: organization_field_id + in: path + description: The ID or key of the organization field + required: true + schema: + oneOf: + - type: integer + - type: string + example: my_text_field + OrganizationId: + name: organization_id + in: path + description: The ID of an organization + required: true + schema: + type: integer + example: 16 + OrganizationIds: + name: ids + in: query + description: A list of organization ids + schema: + type: string + example: 35436,20057623 + OrganizationMembershipId: + name: organization_membership_id + in: path + description: The ID of the organization membership + required: true + schema: + type: integer + example: 4 + OrganizationMembershipsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + Valid values: `users`, `organizations`. + schema: + type: string + example: organizations + OrganizationMergeId: + name: organization_merge_id + in: path + description: The ID of the organization merge + required: true + schema: + type: string + example: 01HPZM6206BF4G63783E5349AD + OrganizationName: + name: name + in: query + description: The name of an organization + schema: + type: string + example: ACME Incorporated + OrganizationQueryFragment: + name: name + in: query + description: A substring of an organization to search for + required: true + schema: + type: string + example: imp + OrganizationSubscriptionId: + name: organization_subscription_id + in: path + description: The ID of the organization subscription + required: true + schema: + type: integer + example: 35436 + OrganizationUserSortBy: + name: sort_by + in: query + description: The field to sort users by + schema: + type: string + enum: + - id + - name + - created_at + - updated_at + OrganizationUserSortOrder: + name: sort_order + in: query + description: The sort order + schema: + type: string + enum: + - asc + - desc + default: asc + OtpSetting: + name: one_time_password + in: query + description: | + Provides configuration for user OTP setting + style: deepObject + explode: true + required: true + schema: + type: object + properties: + code: + type: string + force: + type: boolean + phone: + type: string + time_based: + type: boolean + example: + code: "123321" + force: true + phone: "+3211223213" + time_based: true + Page: + name: page + in: query + description: Page number for offset-based pagination (non-negative integer). + schema: + type: integer + example: 1 + PerPage: + name: per_page + in: query + description: | + Number of records to return per page. + + Note: Default and maximum values vary by endpoint. Check endpoint-specific + documentation for limits. + schema: + type: integer + minimum: 1 + example: 50 + RequestId: + name: request_id + in: path + description: The ID of the request + required: true + schema: + type: integer + example: 33 + ResourceCollectionId: + name: resource_collection_id + in: path + description: The id of the resource collection + required: true + schema: + type: integer + example: 10002 + RoutingAttributesInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + See [Sideloading](/api-reference/ticketing/ticket-management/skill_based_routing/#sideloads). + schema: + type: string + example: attribute_values + SLAPolicyId: + name: sla_policy_id + in: path + description: The ID of the SLA Policy + required: true + schema: + type: integer + example: 36 + SearchInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + The available sideloads depend on the search result types. + schema: + type: string + example: users,organizations + SessionId: + name: session_id + in: path + description: The ID of the session + required: true + schema: + type: integer + example: 14 + SharingAgreementId: + name: sharing_agreement_id + in: path + description: The ID of the sharing agreement + required: true + schema: + type: integer + example: 1 + SkillBasedRoutingAttributeId: + name: attribute_id + in: path + description: The ID of the skill-based routing attribute + required: true + schema: + type: string + example: 6e279587-e930-11e8-a292-09cfcdea1b75 + SkillBasedRoutingAttributeValueId: + name: attribute_value_id + in: path + description: The ID of the skill-based routing attribute value + required: true + schema: + type: string + example: b376b35a-e38b-11e8-a292-e3b6377c5575 + SkipTicketUserId: + name: user_id + in: path + description: User ID of an agent + required: true + schema: + type: integer + example: 35436 + Sort: + name: sort + in: query + description: The field to sort the list. Possible values are "created_at", "updated_at" (ascending order) or "-created_at", "-updated_at" (descending order) + schema: + type: string + example: updated_at + Subdomain: + name: subdomain + in: query + description: Subdomain for a given Zendesk account address + required: true + schema: + type: string + example: Brand1 + SupportAddressId: + name: support_address_id + in: path + description: The ID of the support address + required: true + schema: + type: integer + example: 33 + SuspendedTicketId: + name: id + in: path + description: id of the suspended ticket + required: true + schema: + type: number + example: 35436 + SuspendedTicketIds: + name: ids + in: query + description: A list of suspended ticket ids + schema: + type: string + example: 3436,3437 + SuspendedTicketsDeleteIds: + name: ids + in: query + description: A comma separated list of ids of suspended tickets to delete. + required: true + schema: + type: string + example: 94,141 + SuspendedTicketsRecoverIds: + name: ids + in: query + description: A comma separated list of ids of suspended tickets to recover. + required: true + schema: + type: string + example: 14,77 + SuspendedTicketsSortBy: + name: sort_by + in: query + description: The field to sort the suspended tickets by. One of "author_email", "cause", "created_at", or "subject" + schema: + type: string + example: author_email + SuspendedTicketsSortOrder: + name: sort_order + in: query + description: The order in which to sort the suspended tickets. This can take value `asc` or `desc`. + schema: + type: string + example: asc + TagNameFragment: + name: name + in: query + description: A substring of a tag to search for + schema: + type: string + example: att + TargetFailureId: + name: target_failure_id + in: path + description: The ID of the target failure + required: true + schema: + type: integer + example: 1 + TargetId: + name: target_id + in: path + description: The ID of the target + required: true + schema: + type: integer + example: 211 + TaskListTemplateId: + name: task_list_template_id + in: path + description: The id of the task list template + required: true + schema: + type: string + example: 01K205PG0J2ET0B8AFHA106C1E + TicketAuditId: + name: ticket_audit_id + in: path + description: The ID of the ticket audit + required: true + schema: + type: integer + example: 2127301143 + TicketCommentId: + name: ticket_comment_id + in: path + description: The ID of the ticket comment + required: true + schema: + type: integer + example: 35436 + TicketFieldId: + name: ticket_field_id + in: path + description: The ID of the ticket field + required: true + schema: + type: integer + example: 34 + TicketFieldIds: + name: ticket_field_ids + in: query + description: Comma-separated list of ticket field IDs. Required if `keys` is not provided. + schema: + type: string + example: 8029542048383,8029542048255,8029542069247 + TicketFieldKeys: + name: ticket_field_keys + in: query + description: Comma-separated list of ticket field keys. Required if `ids` is not provided. + schema: + type: string + example: standard::resolution_type + TicketFieldOptionId: + name: ticket_field_option_id + in: path + description: The ID of the ticket field option + required: true + schema: + type: integer + example: 10001 + TicketFormId: + name: ticket_form_id + in: path + description: The ID of the ticket form + required: true + schema: + type: integer + example: 47 + TicketFormStatusId: + name: ticket_form_status_id + in: path + description: The id of the ticket form status + required: true + schema: + type: string + example: abcdef + TicketId: + name: ticket_id + in: path + description: The ID of the ticket + required: true + schema: + type: integer + example: 123456 + TicketIds: + name: ids + in: query + description: Comma-separated list of ticket ids + required: true + schema: + type: string + example: 35436,35437 + TicketSortBy: + name: sort_by + in: query + description: Sort by + schema: + type: string + enum: + - id + - subject + - deleted_at + - created_at + - updated_at + - status + - requester + - requester.name + - group + - assignee + - assignee.name + TicketSortOrder: + name: sort_order + in: query + description: Sort order. Defaults to "asc" + schema: + type: string + enum: + - asc + - desc + TicketSupportTypeScope: + name: support_type_scope + in: query + description: | + Lists tickets by support type. Possible values are "all", "agent", or "ai_agent". Defaults to "agent" + schema: + type: string + TicketsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + See [Sideloading](/api-reference/ticketing/tickets/tickets/#sideloading). + schema: + type: string + example: users,groups,organizations + TriggerActive: + name: active + in: query + description: Filter by active triggers if true or inactive triggers if false + schema: + type: boolean + example: true + TriggerCategoryId: + name: category_id + in: query + description: Filter triggers by category ID + schema: + type: string + example: "10026" + TriggerId: + name: trigger_id + in: path + description: The ID of the trigger + required: true + schema: + type: integer + example: 198 + TriggerIds: + name: ids + in: query + description: A comma separated list of trigger IDs + required: true + schema: + type: string + example: 131,178,938 + TriggerInclude: + name: include + in: query + description: A sideload to include in the response. See [Sideloads](#sideloads-2) + schema: + type: string + example: usage_24h + TriggerRevisionId: + name: trigger_revision_id + in: path + description: The ID of the revision for a particular trigger + required: true + schema: + type: integer + example: 1 + TriggerSearchFilter: + name: filter + in: query + description: | + JSON-encoded trigger attribute filters for the search. See [Filter](#filter). + + Example: `{"json":{"description":"Close a ticket"}}` + schema: + type: string + example: '{"json":{"description":"Close a ticket"}}' + TriggerSearchQuery: + name: query + in: query + description: Query string used to find all triggers with matching title + schema: + type: string + example: important_trigger + TriggerSort: + name: sort + in: query + description: Cursor-based pagination only. Possible values are "alphabetical", "created_at", "updated_at", or "position". + schema: + type: string + example: position + TriggerSortBy: + name: sort_by + in: query + description: Offset pagination only. Possible values are "alphabetical", "created_at", "updated_at", "usage_1h", "usage_24h", or "usage_7d". Defaults to "position" + schema: + type: string + example: position + TriggerSortOrder: + name: sort_order + in: query + description: One of "asc" or "desc". Defaults to "asc" for alphabetical and position sort, "desc" for all others + schema: + type: string + example: desc + UserExternalIdFilter: + name: external_id + in: query + description: List users by external id. External id has to be unique for each user under the same account. + schema: + type: string + example: abc + UserFieldId: + name: user_field_id + in: path + description: The ID or key of the user field + required: true + schema: + oneOf: + - type: integer + - type: string + example: my_text_field + UserFieldOptionId: + name: user_field_option_id + in: path + description: The ID of the user field option + required: true + schema: + type: integer + example: 10001 + UserId: + name: user_id + in: path + description: The id of the user + required: true + schema: + type: integer + example: 35436 + UserIdentityId: + name: user_identity_id + in: path + description: The ID of the user identity + required: true + schema: + type: integer + example: 77938 + UserLogin: + name: user + in: path + description: | + Provides user email and password for password login + style: deepObject + explode: true + required: true + schema: + type: object + properties: + email: + type: string + password: + type: string + example: + email: test@zd-dev.com + password: "123456" + UserPermissionSetFilter: + name: permission_set + in: query + description: For custom roles which is available on the Enterprise plan and above. You can only filter by one role ID per request + schema: + type: integer + example: 123 + UserRoleFilter: + name: role + in: query + description: | + Filters the results by role. Possible values are "end-user", "agent", "admin", or a custom role name + schema: + type: string + example: agent + UserRolesFilter: + name: role[] + in: query + description: | + Filters the results by more than one role using the format `role[]={role}&role[]={role}` + explode: true + schema: + type: string + example: agent + UsersInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + See [Sideloading](/api-reference/ticketing/users/users/#sideloading). + schema: + type: string + example: roles,organizations + ViewId: + name: view_id + in: path + description: The ID of the view + required: true + schema: + type: integer + example: 25 + WorkspaceId: + name: workspace_id + in: path + description: The id of the workspace + required: true + schema: + type: integer + example: 3133 + examples: + AccessRuleCreateRequestExample: + value: + access_rule: + conditions: + all: + - field: created_by_user + operator: matches + value: current_user + any: + - field: custom_object.order.custom_fields.status + operator: is + value: pending + description: Access rule that limits access to orders created by the current user + title: Orders Created by Current User + AccessRuleDefinitionsResponseExample: + value: + definitions: + conditions_all: + - group: custom_object + metadata: + collection_key: users + field_id: null + item_key: user + source: null + url: api/v2/users/autocomplete + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Matches + value: matches + repeatable: false + subject: created_by_user + title: Created By + type: autocomplete + values: + - dynamic: true + enabled: true + title: (current user) + value: current_user + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + repeatable: false + subject: name + title: Name + type: text + - group: custom_object + nullable: true + operators: + - terminal: false + title: Includes + value: includes + - terminal: false + title: Does not include + value: not_includes + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_object.all_field_type_object.custom_fields.custom_multiselect + title: custom_multiselect + type: list + values: + - enabled: true + title: "111" + value: "111" + - enabled: true + title: "222" + value: "222" + - enabled: true + title: "333" + value: "333" + - group: custom_object + metadata: + collection_key: brands + field_id: 12345678 + item_key: brand + source: null + url: api/v2/brands/autocomplete + nullable: true + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: false + title: Matches + value: matches + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_object.all_field_type_object.custom_fields.assigned_brand + title: Assigned Brand + type: autocomplete + values: + - dynamic: true + enabled: true + title: (current user's brands) + value: current_user_brand + conditions_any: + - group: custom_object + metadata: + collection_key: users + field_id: null + item_key: user + source: null + url: api/v2/users/autocomplete + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Matches + value: matches + repeatable: false + subject: created_by_user + title: Created By + type: autocomplete + values: + - dynamic: true + enabled: true + title: (current user) + value: current_user + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + repeatable: false + subject: name + title: Name + type: text + - group: custom_object + metadata: + collection_key: brands + field_id: 12345678 + item_key: brand + source: null + url: api/v2/brands/autocomplete + nullable: true + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: false + title: Matches + value: matches + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_object.all_field_type_object.custom_fields.assigned_brand + title: Assigned Brand + type: autocomplete + values: + - dynamic: true + enabled: true + title: (current user's brands) + value: current_user_brand + AccessRuleResponseExample: + value: + access_rule: + conditions: + all: + - field: created_by_user + operator: matches + value: current_user + any: + - field: custom_object.order.custom_fields.status + operator: is + value: pending + created_at: "2025-09-17T10:15:30Z" + description: Access rule that limits access to orders created by the current user + id: 6862342718335 + title: Orders Created by Current User + updated_at: "2025-09-17T14:30:45Z" + AccessRuleUpdateRequestExample: + value: + access_rule: + conditions: + all: + - field: custom_object.order.custom_fields.total_amount + operator: greater_than + value: "1000" + description: Access rule for orders above a certain value + title: High Value Orders + AccessRulesResponseExample: + value: + access_rules: + - conditions: + all: + - field: created_by_user + operator: matches + value: current_user + any: + - field: custom_object.order.custom_fields.status + operator: is + value: pending + created_at: "2025-09-17T10:15:30Z" + description: Access rule that limits access to orders created by the current user + id: 6862342718335 + title: Orders Created by Current User + updated_at: "2025-09-17T14:30:45Z" + AccountSettingsResponseExample: + value: + settings: + active_features: + agent_forwarding: false + allow_ccs: true + allow_email_template_customization: true + automatic_answers: false + bcc_archiving: false + benchmark_opt_out: false + business_hours: false + chat: false + chat_about_my_ticket: false + csat_reason_code: false + custom_dkim_domain: true + customer_context_as_default: false + customer_satisfaction: false + dynamic_contents: false + explore: true + explore_on_support_ent_plan: false + explore_on_support_pro_plan: false + facebook: false + facebook_login: false + fallback_composer: false + forum_analytics: true + good_data_and_explore: false + google_login: false + is_abusive: false + light_agents: false + markdown: false + on_hold_status: false + organization_access_enabled: true + rich_content_in_emails: true + sandbox: false + satisfaction_prediction: false + suspended_ticket_notification: false + ticket_forms: true + ticket_tagging: true + topic_suggestion: false + twitter: true + twitter_login: false + user_org_fields: true + user_tagging: true + voice: true + agents: + agent_home: false + agent_workspace: false + aw_self_serve_migration_enabled: true + focus_mode: false + idle_timeout_enabled: false + unified_agent_statuses: false + api: + accepted_api_agreement: true + api_password_access_end_users: true + api_token_access: "true" + apps: + create_private: true + create_public: false + use: true + billing: + backend: zuora + branding: + favicon_url: null + header_color: 78A300 + header_logo_url: null + page_background_color: "333333" + tab_background_color: 7FA239 + text_color: FFFFFF + brands: + default_brand_id: 1873 + end_user_across_brand_requests: false + require_brand_on_new_tickets: false + cdn: + cdn_provider: default + fallback_cdn_provider: secondary + hosts: + - name: default + url: https://static.zdassets.com + - name: secondary + url: https://static-fallback.zdassets.com + chat: + available: true + enabled: false + integrated: true + maximum_request_count: 1 + welcome_message: Hi there. How can I help today? + cross_sell: + show_chat_tooltip: true + xsell_source: null + email: + accept_wildcard_emails: false + custom_dkim_domain: false + email_sender_authentication: true + email_sender_authentication_profile: enhanced + email_status: true + email_template_photos: true + email_template_selection: false + gmail_actions: true + html_mail_template: "\r\n\r\n\r\n \r\n \r\n\r\n\r\n
\r\n
{{delimiter}}
\r\n {{content}}\r\n

\r\n
\r\n {{footer}} {{footer_link}}\r\n

\r\n {{quoted_content}}\r\n\r\n\r\n" + mail_delimiter: '{{txt.email.delimiter}}' + modern_email_template: true + no_mail_delimiter: true + personalized_replies: true + rich_content_in_emails: true + send_gmail_messages_via_gmail: true + text_mail_template: "{{content}}\r\n\r\n{{footer}}\r\n\r\n{{quoted_content}}" + google_apps: + has_google_apps: false + has_google_apps_admin: false + groups: + check_group_name_uniqueness: true + limits: + attachment_size: 52428800 + localization: + locale_ids: + - 1042 + lotus: + pod_id: 999 + prefer_lotus: true + reporting: true + messaging_inactivity: + default_localized_messages: + pre_solved_message_1: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + pre_solved_message_2: This ticket will be marked as solved soon. We hope to hear from you. + solved_message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + enabled: true + reminders: + - message: Waiting on your response. If we don't hear from you within a few minutes, this ticket will be marked as solved. + - message: This ticket will be marked as solved soon. We hope to hear from you. + ticket_status_id: null + timeout: 300 + - message: As we haven't heard from you in a while, we'll be marking this ticket as solved. + ticket_status_id: 8678123367037 + timeout: 60 + ticket_status_id: 8001424138749 + timeout: 5 + metrics: + account_size: 100-399 + onboarding: + checklist_onboarding_version: 2 + onboarding_segments: null + product_sign_up: null + routing: + autorouting_tag: "" + enabled: false + max_email_capacity: 0 + max_messaging_capacity: 0 + rule: + macro_most_used: true + macro_order: alphabetical + skill_based_filtered_views: [ ] + using_skill_based_routing: false + side_conversations: + email_channel: false + msteams_channel: false + show_in_context_panel: false + slack_channel: false + tickets_channel: false + statistics: + forum: true + rule_usage: true + search: true + ticket_form: + raw_ticket_forms_instructions: Please choose your issue below + ticket_forms_instructions: Please choose your issue below + tickets: + accepted_new_collaboration_tos: false + agent_collision: true + agent_invitation_enabled: true + agent_ticket_deletion: false + allow_group_reset: true + assign_default_organization: true + assign_tickets_upon_solve: true + auto_translation_enabled: false + auto_updated_ccs_followers_rules: false + chat_sla_enablement: false + collaboration: true + comments_public_by_default: true + default_solved_ticket_reassignment_strategy: legacy + default_to_draft_mode: false + email_attachments: false + emoji_autocompletion: true + follower_and_email_cc_collaborations: false + has_color_text: true + is_first_comment_private_enabled: true + light_agent_email_ccs_allowed: false + list_empty_views: true + list_newest_comments_first: true + markdown_ticket_comments: false + maximum_personal_views_to_list: 8 + modern_ticket_reassignment: false + private_attachments: false + rich_text_comments: true + show_modern_ticket_reassignment: false + status_hold: false + tagging: true + using_skill_based_routing: false + twitter: + shorten_url: optional + user: + agent_created_welcome_emails: true + end_user_phone_number_validation: false + have_gravatars_enabled: true + language_selection: true + multiple_organizations: false + tagging: true + time_zone_selection: true + voice: + agent_confirmation_when_forwarding: true + agent_wrap_up_after_calls: true + enabled: true + logging: true + maximum_queue_size: 5 + maximum_queue_wait_time: 1 + only_during_business_hours: false + outbound_enabled: true + recordings_public: true + uk_mobile_forwarding: true + ActivitiesCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + ActivitiesResponseExample: + value: + activities: + - actor: + active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + actor_id: 158488612 + created_at: "2020-11-17T00:34:40Z" + id: 29183462 + object: + ticket: + id: 1521 + subject: test + target: + ticket: + id: 1521 + subject: test + title: 'Tedd assigned ticket #1521 to you.' + updated_at: "2020-11-17T00:34:40Z" + url: https://example.zendesk.com/api/v2/activities/29183462 + user: + active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + user_id: 3343 + verb: tickets.assignment + actors: + - active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + count: 1 + next_page: null + previous_page: null + users: + - active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + ActivityResponseExample: + value: + activity: + actor: + active: true + alias: "" + created_at: "2020-11-17T00:32:12Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: cgoddard+ted@zendesk.com + external_id: null + iana_time_zone: America/Juneau + id: 158488612 + last_login_at: "2020-11-17T00:33:44Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Tedd + notes: "" + only_private_comments: false + organization_id: null + phone: null + photo: null + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: "" + suspended: false + tags: [ ] + ticket_restriction: null + time_zone: Alaska + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:34:38Z" + url: https://example.zendesk.com/api/v2/users/158488612 + user_fields: + its_remember_september: null + skittles: null + user_field_1: null + verified: true + actor_id: 158488612 + created_at: "2020-11-17T00:34:40Z" + id: 29183462 + object: + ticket: + id: 1521 + subject: test + target: + ticket: + id: 1521 + subject: test + title: 'Tedd assigned ticket #1521 to you.' + updated_at: "2020-11-17T00:34:40Z" + url: https://example.zendesk.com/api/v2/activities/29183462 + user: + active: true + alias: test + created_at: "2017-08-14T20:13:53Z" + custom_role_id: null + default_group_id: 1873 + details: "" + email: user@zendesk.com + external_id: oev7jj + iana_time_zone: Pacific/Pago_Pago + id: 3343 + last_login_at: "2020-11-16T22:57:45Z" + locale: en-gb + locale_id: 5 + moderator: true + name: Samwise Gamgee + notes: test + only_private_comments: false + organization_id: 1873 + phone: null + photo: + content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + deleted: false + file_name: 1f84950b8d7949b3.gif + height: 80 + id: 8730791 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730791/1f84950b8d7949b3.gif + size: 4566 + thumbnails: + - content_type: image/gif + content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + deleted: false + file_name: 1f84950b8d7949b3_thumb.gif + height: 32 + id: 8730801 + inline: false + mapped_content_url: https://example.zendesk.com/system/photos/8730801/1f84950b8d7949b3_thumb.gif + size: 1517 + url: https://example.zendesk.com/api/v2/attachments/8730801 + width: 32 + url: https://example.zendesk.com/api/v2/attachments/8730791 + width: 80 + report_csv: true + restricted_agent: false + role: admin + role_type: null + shared: false + shared_agent: false + shared_phone_number: null + signature: test + suspended: false + tags: + - "101" + ticket_restriction: null + time_zone: American Samoa + two_factor_auth_enabled: null + updated_at: "2020-11-17T00:33:55Z" + url: https://example.zendesk.com/api/v2/users/3343 + user_fields: + its_remember_september: null + skittles: "2018-09-14T00:00:00+00:00" + user_field_1: "101" + verified: true + user_id: 3343 + verb: tickets.assignment + AddTagsByObjectIdResponseExample: + value: + tags: + - urgent + - printer + - fire + - paper + ApprovalRequestCreateRequestExample: + value: + assignee_user_id: 456 + message: Please approve this request for a new laptop for the engineering team + subject: Laptop Purchase Approval + ticket_id: 123 + ApprovalRequestCreateRequestWithGroupExample: + value: + assignee_group_id: 789 + message: Please approve this request for new office equipment for the support team + subject: Office Equipment Approval + ticket_id: 123 + ApprovalRequestErrorExample: + value: + errors: + - code: ApprovalRequestCreationFailed + title: Approval request couldn't be sent because one active, approved, or denied request already exists + ApprovalRequestSimpleResponseExample: + value: + approval_request: + assignee_group_id: null + assignee_user_id: 456 + created_at: "2026-01-23T19:02:36Z" + created_by_id: 789 + id: 01KFP3S9EVXF9CKAYY080NV98C + message: Please approve this request for a new laptop for the engineering team + origination_type: API_ORIGINATION + status: active + subject: Laptop Purchase Approval + ticket_id: 123 + ApprovalRequestsListResponseExample: + value: + approval_requests: + - assignee_user: + id: 12345 + name: Jane Approver + created_at: "2025-02-26T10:30:00Z" + id: 01HX123ABC + message: Please approve the software license request + origination_type: API_ORIGINATION + status: active + subject: Software License Approval + ticket_id: 101 + - assignee_group: + id: 456 + name: Approval Team + created_at: "2025-02-25T14:15:00Z" + id: 01HX123DEF + message: Please approve the hardware request + origination_type: UI_ORIGINATION + status: approved + subject: Hardware Request + ticket_id: 102 + links: + next: null + prev: null + meta: + after_cursor: null + before_cursor: null + has_more: false + AssigneeFieldAssignableGroupAgentsResponseExample: + value: + agents: + - avatar_url: https://z3n-example.zendesk.com/system/photos/900005192023/my_profile.png + id: 6473829100 + name: Joe Smith + - avatar_url: https://z3n-example.zendesk.com/system/photos/412005192023/my_profile.png + id: 9182736400 + name: Jane Doe + - avatar_url: https://z3n-example.zendesk.com/system/photos/887005192023/my_profile.png + id: 1928373460 + name: Cookie Monster + count: 3 + next_page: null + previous_page: null + AssigneeFieldAssignableGroupsAndAgentsSearchResponseExample: + value: + agents: + - group: Tech + group_id: 6574839201 + id: 8392017465 + name: Sam Technologist + photo_url: https://z3n-example.zendesk.com/system/photos/410305192023/my_profile.png + count: 2 + groups: + - id: 6574839201 + name: Tech + AssigneeFieldAssignableGroupsResponseExample: + value: + count: 3 + groups: + - description: Engineering + id: 9182736455 + name: Group for Bugs for Engineering + - description: Product + id: 1928374655 + name: Group for feature requests + - description: Customer Support + id: 5519283746 + name: Group for customer inquiries + next_page: null + previous_page: null + AttachmentResponseExample: + value: + attachment: + content_type: application/binary + content_url: https://company.zendesk.com/attachments/myfile.dat + file_name: myfile.dat + id: 498483 + size: 2532 + thumbnails: [ ] + url: https://company.zendesk.com/api/v2/attachments/498483 + AttachmentUpdateRequestExample: + value: + attachment: + malware_access_override: true + AttachmentUploadResponseExample: + value: + upload: + attachment: + content_type: image/png + content_url: https://company.zendesk.com/attachments/token/tyBq1ms40dFaHefSIigxZpwGg/?name=crash.png + deleted: false + file_name: crash.png + height: 62 + id: 1503729607981 + inline: false + mapped_content_url: https://company.zendesk.com/attachments/token/tyBq1ms40dFaHefSIigxZpwGg/?name=crash.png + size: 5172 + thumbnails: [ ] + url: https://company.zendesk.com/api/v2/attachments/1503729607981 + width: 80 + attachments: + - content_type: image/png + content_url: https://company.zendesk.com/attachments/token/tyBq1ms40dFaHefSIigxZpwGg/?name=crash.png + deleted: false + file_name: crash.png + height: 62 + id: 1503729607981 + inline: false + mapped_content_url: https://company.zendesk.com/attachments/token/tyBq1ms40dFaHefSIigxZpwGg/?name=crash.png + size: 5172 + thumbnails: [ ] + url: https://company.zendesk.com/api/v2/attachments/1503729607981 + width: 80 + token: LXJdriewLBP8JrtzzkN7Ne4k6 + AuditLogResponseExample: + value: + audit_log: + action: update + actor_id: 1234 + actor_name: Sameer Patel + change_description: Role changed from Administrator to End User + created_at: "2012-03-05T11:32:44Z" + id: 498483 + ip_address: 209.119.38.228 + source_id: 3456 + source_label: John Doe + source_type: user + url: https://company.zendesk.com/api/v2/audit_logs/498483 + AuditLogsResponseExample: + value: + audit_logs: + - action: update + actor_id: 1234 + actor_name: Sameer Patel + change_description: Role changed from Administrator to End User + created_at: "2012-03-05T11:32:44Z" + id: 498483 + ip_address: 209.119.38.228 + source_id: 3456 + source_label: John Doe + source_type: user + url: https://company.zendesk.com/api/v2/audit_logs/498483 + AutocompleteOrganizationsResponseExample: + value: + count: 2 + next_page: null + organizations: + - created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: null + group_id: 1835962 + id: 35436 + name: Important Customers + notes: donkey + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + - created_at: "2017-08-14T20:13:52Z" + details: test + domain_names: + - test.com + external_id: null + group_id: null + id: 20057623 + name: Imperial College + notes: "" + organization_fields: + datepudding: "2018-11-02T00:00:00+00:00" + org_field_1: malarky + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - teapot_kettle + updated_at: "2019-05-16T01:27:46Z" + url: https://example.zendesk.com.com/api/v2/organizations/1873 + previous_page: null + AutomationCreateResponseExample: + value: + automation: + actions: + - field: priority + value: high + active: true + conditions: + all: + - field: status + operator: is + value: open + - field: priority + operator: less_than + value: high + any: [ ] + id: 9873843 + position: 8 + raw_title: Roger Wilco + title: Roger Wilco + AutomationResponseExample: + value: + automation: + actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + AutomationsResponseExample: + value: + automations: + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: false + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 26 + position: 9 + raw_title: '{{dc.assign_priority_tag}}' + title: Assign priority tag + count: 2 + next_page: null + previous_page: null + AutomationsSearchResponseExample: + value: + automations: + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 25 + position: 9 + raw_title: Close and Save + title: Close and Save + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 28 + position: 9 + raw_title: '{{dc.close_and_redirect}}' + title: Close and redirect to topics + count: 2 + next_page: null + previous_page: null + AutomationsUpdateManyResponseExample: + value: + automations: + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 25 + position: 15 + raw_title: Close and Save + title: Close and Save + - actions: + - field: status + value: open + - field: assignee_id + value: "296220096" + active: false + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: current_tags + operator: includes + value: hello + id: 26 + position: 8 + raw_title: '{{dc.assign_priority_tag}}' + title: Assign priority tag + count: 2 + next_page: null + previous_page: null + BookmarkCreateRequest: + value: + bookmark: + ticket_id: 113 + BookmarkResponse: + value: + bookmark: + created_at: "2020-10-01T08:33:45Z" + id: 900000009567 + ticket: + id: 123 + priority: high + raw_subject: Chat with Visitor 19785128 + requester_id: 156 + subject: Chat with Visitor 19785128 + url: https://{subdomain}.zendesk.com/api/v2/tickets/123 + url: https://{subdomain}.zendesk.com/api/v2/bookmarks/900000001111 + BookmarksResponse: + value: + bookmarks: + - created_at: "2020-10-01T08:33:45Z" + id: 900000009567 + ticket: + id: 123 + priority: high + raw_subject: Chat with Visitor 19785128 + requester_id: 165 + subject: Chat with Visitor 19785128 + url: https://{subdomain}.zendesk.com/api/v2/tickets/123 + url: https://{subdomain}.zendesk.com/api/v2/bookmarks/900000001111 + - created_at: "2020-09-11T10:22:45Z" + id: 900000009568 + ticket: + id: 123 + priority: high + raw_subject: Chat with Visitor 19785128 + requester_id: 156 + subject: Chat with Visitor 19785128 + url: https://{subdomain}.zendesk.com/api/v2/tickets/123 + url: https://{subdomain}.zendesk.com/api/v2/bookmarks/900000001112 + count: 1 + next_page: null + previous_page: null + BrandAgentResponseExample: + value: + brand_agent: + brand_id: 88 + created_at: "2012-04-03T12:34:01Z" + id: "461" + updated_at: "2012-04-03T12:34:01Z" + user_id: 72 + BrandAgentsResponseExample: + value: + brand_agents: + - brand_id: 12 + created_at: "2009-05-13T00:07:08Z" + id: "4" + updated_at: "2011-07-22T00:11:12Z" + user_id: 29 + - brand_id: 3 + created_at: "2012-03-13T22:01:32Z" + id: "49" + updated_at: "2012-03-13T22:01:32Z" + user_id: 155 + BrandCreateRequestExample: + value: + brand: + name: Brand 1 + subdomain: Brand1 + BrandResponseExample: + value: + brand: + active: true + brand_url: https://brand1.zendesk.com + created_at: "2019-08-06T02:43:39Z" + default: true + has_help_center: true + help_center_state: enabled + host_mapping: brand1.com + id: 360002783572 + is_deleted: false + logo: + content_type: image/png + content_url: https://company.zendesk.com/logos/brand1_logo.png + file_name: brand1_logo.png + id: 928374 + mapped_content_url: https://company.com/logos/brand1_logo.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_thumb.png + file_name: brand1_logo_thumb.png + id: 928375 + mapped_content_url: https://company.com/photos/brand1_logo_thumb.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928375 + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_small.png + file_name: brand1_logo_small.png + id: 928376 + mapped_content_url: https://company.com/photos/brand1_logo_small.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928376 + url: https://company.zendesk.com/api/v2/attachments/928374 + name: Brand 1 + signature_template: '{{agent.signature}}' + subdomain: hello-world + ticket_form_ids: + - 360000660811 + updated_at: "2019-08-06T02:43:40Z" + url: https://company.zendesk.com/api/v2/brands/360002783572 + BrandUpdateRequestExample: + value: + brand: + active: true + host_mapping: brand1.com + name: Brand 1 + subdomain: Brand1 + BrandsResponseExample: + value: + brands: + - active: true + brand_url: https://brand1.zendesk.com + created_at: "2019-08-06T02:43:39Z" + default: true + has_help_center: true + help_center_state: enabled + host_mapping: brand1.com + id: 360002783572 + is_deleted: false + logo: + content_type: image/png + content_url: https://company.zendesk.com/logos/brand1_logo.png + file_name: brand1_logo.png + id: 928374 + mapped_content_url: https://company.com/logos/brand1_logo.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_thumb.png + file_name: brand1_logo_thumb.png + id: 928375 + mapped_content_url: https://company.com/photos/brand1_logo_thumb.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928375 + - content_type: image/png + content_url: https://company.zendesk.com/photos/brand1_logo_small.png + file_name: brand1_logo_small.png + id: 928376 + mapped_content_url: https://company.com/photos/brand1_logo_small.png + size: 58298 + url: https://company.zendesk.com/api/v2/attachments/928376 + url: https://company.zendesk.com/api/v2/attachments/928374 + name: Brand 1 + signature_template: '{{agent.signature}}' + subdomain: hello-world + ticket_form_ids: + - 360000660811 + updated_at: "2019-08-06T02:43:40Z" + url: https://company.zendesk.com/api/v2/brands/360002783572 + count: 1 + next_page: null + previous_page: null + BulkSkillBasedRoutingAttributeValuesErrorExample: + value: + error: + message: 'You passed an invalid value for the job.items attribute. Invalid parameter: job.items must be an integer from api/v2/routing/instance_values/update_many_agent_instance_values' + title: Invalid attribute + BulkSkillBasedRoutingAttributeValuesJobStatusResponseExample: + value: + job_status: + id: V3-25da3dc252ff0f7b63f65d9a8c3ead61 + job_type: Bulk upsert/update/delete agent instance values + message: null + progress: null + results: null + status: queued + total: 2 + url: https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99 + BulkSkillBasedRoutingAttributeValuesRequestExample: + value: + job: + action: upsert + attributes: + attribute_values: + - agent_skill_priority: NORMAL + id: b376b35a-e38b-11e8-a292-e3b6377c5575 + items: + - 224 + - 225 + BulkUpdateDefaultCustomStatusRequestExample: + value: + ids: 1234567,1234577 + BulkUpdateDefaultCustomStatusResponseExample: + value: { } + ChannelFrameworkPushResultsResponseExample: + value: + results: + - external_resource_id: "234" + status: + code: could_not_locate_parent_external_resource + description: "123" + ComplianceDeletionStatusesResponseExample: + value: + compliance_deletion_statuses: + - account_subdomain: accountABC + action: request_deletion + application: all + created_at: "2009-07-20T22:55:23Z" + executer_id: 2000 + user_id: 1 + - account_subdomain: accountABC + action: started + application: support + created_at: "2009-07-20T22:55:29Z" + executer_id: null + user_id: 1 + - account_subdomain: accountABC + action: complete + application: support + created_at: "2009-07-20T22:57:02Z" + executer_id: null + user_id: 1 + - account_subdomain: accountABC + action: started + application: chat + created_at: "2009-07-21T02:51:18Z" + executer_id: null + user_id: 1 + ConversationLogResponseExample: + value: + events: + - attachments: [ ] + author: + avatar_url: https://static.zdassets.com/web_widget/latest/default_avatar.png + display_name: SampleBot + type: bot + zen:sunco:user_id: a21a91fd1234a + zen:support:user_id: -1 + content: + actions: + - reply: + payload: goto_node=01J9WVC919KKCBB0WKC42YQMCT_01J9Z7SYB9EGXNGT8DQV3KX4F2 + text: Talk to a human + text: Hey! Have a question? I'm here to assist. + type: text + created_at: 2025-04-22T09:24:26Z + id: 02JSED093DTX4RTDRRJXN2YKB0 + metadata: + custom: { } + system: { } + ticket_version: 0 + received_at: 2025-04-22T09:24:26.861Z + reference: zen:sunco:conversation_message:6807603a38564290f5a086c2 + source: + type: zd:answerBot + type: Messaging::ConversationMessage + - attachments: [ ] + author: + display_name: sample user + type: user + zen:support:user_id: 8303911923701 + content: + body: |- +

Conversation with wp native

+ +

URL: None

+ type: html + created_at: 2025-04-22T09:24:46Z + id: 01JSED0VSGBJP9TJ471NTUGYYD + metadata: + custom: { } + public: false + system: { } + ticket_version: 0 + reference: zen:ticket_event:8639371328313 + type: Comment + links: + next: https://company.zendesk.com/api/v2/tickets/123/conversation_log?page%5Bafter%5D=eyJvIjziaWQiLCJ2IjoiY3hvQUFBQXdNVXBUUlVSTk1WRkxXVGMxVFZSYVMwSk5SRXN8VnpRMVJ3PT0ifQ%3D%3D&sort=created_at + prev: https://company.zendesk.com/api/v2/tickets/123/conversation_log?page%5Bbefore%5D=eyJvIjoiaWQiJKJ2IjoiY3hvQUFBQXdNVXBUUlVRd09UTkVWRmcwVWxSRVVsSktXRTR3V1V0Q03BPT0ifQ%3D%3D&sort=created_at + meta: + after_cursor: eyJvIjoiaWQiLCJ2IjoiY3hvQUFBQXdNVXBUUlVERk1WRkxXVGMxVFZSYVMwSk5SRXN6VnpRMVJ3PT0ifQ== + before_cursor: eyJvIjoiaWQiLCJ4IjoiY3hvQUFBQXdSDEBUUlVRd09UTkVWRmcwVWxSRVVsSktXRTR3V1V0Q01BPT0ifQ== + has_more: false + CountOrganizationsResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + CreateDeletionScheduleRequestExample: + value: + deletion_schedule: + active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + description: Delete tickets older than 1 year + title: some schedule + CreateDeletionScheduleResponseExample: + value: + deletion_schedule: + active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + created_at: "2021-07-20T22:55:29Z" + default: false + description: Delete tickets older than 1 year + id: 7772196094461 + title: some schedule + updated_at: "2021-07-20T22:55:29Z" + url: https://{some domain}.zendesk.com/api/v2/deletion_schedules/7772196094461 + CreateMacroResponseExample: + value: + macro: + actions: + - field: status + value: solved + id: 25 + restriction: { } + title: Roger Wilco + CreateOrganizationRequestExample: + value: + organization: + name: My Organization + CreatedOrganizationResponseExample: + value: + organization: + created_at: "2020-09-30T01:50:12Z" + details: null + domain_names: [ ] + external_id: null + group_id: null + id: 23409462 + name: My Organization + notes: null + organization_fields: null + shared_comments: false + shared_tickets: false + tags: [ ] + updated_at: "2020-09-30T01:50:12Z" + url: https://example.zendesk.com/api/v2/organizations/23409462 + CurrentUserResponseExample: + value: + user: + active: true + alias: Mr. Johnny + authenticity_token: + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + CursorBasedExportIncrementalTicketsResponseExample: + value: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://{subdomain}.zendesk.com/api/v2/incremental/tickets/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + end_of_stream: true + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + CursorBasedExportIncrementalUsersResponseExample: + value: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://{subdomain}.zendesk.com/api/v2/incremental/users/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + end_of_stream: true + users: + - active: true + alias: Mr. Johnny + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + CustomObjectFieldCreateResponseExample: + value: + custom_object_field: + active: true + created_at: 2022-09-07T23:21:59Z + description: Make + id: 4398096842879 + key: make + position: 0 + raw_description: Make + raw_title: Make + regexp_for_validation: null + required: false + system: false + title: Make + type: text + updated_at: 2022-09-07T23:22:00Z + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/fields?id=4398096842879 + CustomObjectFieldsCreateRequestExample: + value: + custom_object_field: + key: color + title: Color + type: text + CustomObjectFieldsLimitResponseExample: + value: + count: 44 + limit: 400 + CustomObjectFieldsResponseExample: + value: + custom_object_fields: + - active: true + created_at: 2022-09-07T23:21:59Z + description: Name + id: 4398096842877 + key: standard::name + position: 0 + properties: + autoincrement_enabled: true + autoincrement_next_sequence: 1 + autoincrement_padding: 5 + autoincrement_prefix: 'Order # ' + is_unique: false + raw_description: Name + raw_title: Name + regexp_for_validation: null + required: true + system: false + title: Name + type: text + updated_at: 2022-09-07T23:22:00Z + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/fields?id=4398096842877 + - active: true + created_at: 2022-09-07T23:21:59Z + description: External ID + id: 4398096842878 + key: standard::external_id + position: 1 + raw_description: External ID + raw_title: External ID + regexp_for_validation: null + required: false + system: false + title: External ID + type: text + updated_at: 2022-09-07T23:22:00Z + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/fields?id=4398096842878 + - active: true + created_at: 2022-09-07T23:22:14Z + description: Model + id: 4398096843007 + key: model + position: 2 + raw_description: Model + raw_title: Model + regexp_for_validation: null + required: true + system: false + title: Model + type: text + updated_at: 2022-09-07T23:22:14Z + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/fields?id=4398096843007 + CustomObjectRecordAttachmentCreateRequestExample: + summary: Create custom object record attachment request + value: + uploaded_data: '[binary file content]' + CustomObjectRecordAttachmentCreateResponseExample: + summary: Create custom object record attachment response + value: + custom_object_record_attachment: + content_type: application/pdf + content_url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/attachments/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/download + created_at: "2024-01-15T14:30:00Z" + created_by: John Doe + custom_object_record_id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + filename: contract.pdf + id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + malware_access_override: false + malware_scan_completed_at: null + malware_scan_status: not_scanned + size: 245760 + CustomObjectRecordAttachmentUpdateRequestExample: + summary: Update custom object record attachment request + value: + custom_object_record_attachment: + malware_access_override: true + CustomObjectRecordAttachmentUpdateResponseExample: + summary: Update custom object record attachment response + value: + custom_object_record_attachment: + content_type: application/octet-stream + content_url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/attachments/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/download + created_at: "2024-01-15T14:30:00Z" + created_by: John Doe + custom_object_record_id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + filename: potentially_malicious_file.exe + id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + malware_access_override: true + malware_scan_completed_at: "2024-01-15T14:31:00Z" + malware_scan_status: malware_found + size: 1024000 + CustomObjectRecordAttachmentsIndexResponseExample: + summary: List custom object record attachments response + value: + custom_object_record_attachments: + - content_type: application/pdf + content_url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/attachments/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/download + created_at: "2024-01-15T14:30:00Z" + created_by: John Doe + custom_object_record_id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + filename: contract.pdf + id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + malware_access_override: false + malware_scan_completed_at: "2024-01-15T14:31:00Z" + malware_scan_status: malware_not_found + size: 245760 + - content_type: image/jpeg + content_url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HQ2Z3X4Y5T6R7S8P9Q0W1E2/attachments/01HQ2Z3X4Y5T6R7S8P9Q0W1E3/download + created_at: "2024-01-15T14:31:00Z" + created_by: Jane Smith + custom_object_record_id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E2 + filename: floorplan.jpg + id: 01HQ2Z3X4Y5T6R7S8P9Q0W1E3 + malware_access_override: false + malware_scan_completed_at: "2024-01-15T14:32:00Z" + malware_scan_status: malware_not_found + size: 512000 + CustomObjectRecordsAutocompleteResponseExample: + value: + count: 100 + custom_object_records: + - created_at: "2022-09-12T19:29:59Z" + created_by_user_id: "10001" + custom_object_fields: + make: Tesla + model: S + custom_object_key: car + external_id: Internal System Record 54848 + id: 01GCSJW391QVSC80GYDH7E93Q6 + name: My Tesla CO record + updated_at: "2022-09-15T21:07:03Z" + updated_by_user_id: "10001" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 + - created_at: "2022-09-26T22:24:15Z" + created_by_user_id: "123123" + custom_object_fields: + make: Honda + model: Civic + custom_object_key: car + external_id: null + id: 01GDXYD7ZTWYP542BA8MDDTE36 + name: My Tesla CO record2 + updated_at: "2022-09-26T22:24:15Z" + updated_by_user_id: "245159" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36 + links: + next: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/autocomplete?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query= + prev: null + meta: + after_cursor: eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0= + before_cursor: null + has_more: true + CustomObjectRecordsBulkCreateRequestExample: + value: + job: + action: create + items: + - custom_object_fields: + color: Red + year: 2020 + name: 2020 Tesla + - custom_object_fields: + color: Blue + external_id: ddd444 + year: 2012 + name: 2012 Toyota + - custom_object_fields: + color: Silver + external_id: ddd445 + year: 2017 + name: 2017 Ford + CustomObjectRecordsCreateRequestExample: + value: + custom_object_record: + custom_object_fields: + make: Tesla + model: "Y" + name: My car 1 + CustomObjectRecordsCreateResponseExample: + value: + custom_object_record: + created_at: "2022-09-26T22:25:10Z" + created_by_user_id: "10001" + custom_object_fields: + color: white + make: Tesla + model: "Y" + custom_object_key: car + external_id: null + id: 01GDXYEY1FQYN066VHF49YHJ21 + name: My Tesla + photo: + content_type: image/png + content_url: https://company.zendesk.com/record_photos/my_funny_pic.png + id: 928374 + name: my_funny_pic.png + size: 166144 + updated_at: 2022-09-26T22:25:10Z + updated_by_user_id: "10001" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21 + CustomObjectRecordsFilteredSearchRequestExample: + value: + filter: + $and: + - custom_object_fields.key_one: + $eq: foo + - custom_object_fields.key_two: + $eq: bar + $or: + - custom_object_fields.key_three: + $eq: foo + - custom_object_fields.key_four: + $eq: bar + CustomObjectRecordsIndexResponseExample: + value: + custom_object_records: + - created_at: "2022-09-12T19:29:59Z" + created_by_user_id: "10001" + custom_object_fields: + make: Tesla + model: S + custom_object_key: car + external_id: Internal System Record 54848 + id: 01GCSJW391QVSC80GYDH7E93Q6 + name: My Tesla CO record + updated_at: "2022-09-15T21:07:03Z" + updated_by_user_id: "10001" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 + - created_at: "2022-09-26T22:24:15Z" + created_by_user_id: "123123" + custom_object_fields: + make: Honda + model: Civic + custom_object_key: car + external_id: null + id: 01GDXYD7ZTWYP542BA8MDDTE36 + name: My Tesla CO record2 + updated_at: "2022-09-26T22:24:15Z" + updated_by_user_id: "245159" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36 + links: + next: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query= + prev: null + meta: + after_cursor: eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0= + before_cursor: null + has_more: true + CustomObjectRecordsJobsResponseExample: + value: + job_status: + id: V3-291e720c98aef4d953563ab090486213 + message: null + progress: null + results: null + status: queued + total: 2 + url: https://{subdomain}.zendesk.com/api/v2/job_statuses/V3-291e720c98aef4d953563ab090486213 + CustomObjectRecordsLimitResponseExample: + value: + count: 10294 + limit: 1000000 + CustomObjectRecordsSearchResponseExample: + value: + count: 100 + custom_object_records: + - created_at: "2022-09-12T19:29:59Z" + created_by_user_id: "10001" + custom_object_fields: + make: Tesla + model: S + custom_object_key: car + external_id: Internal System Record 54848 + id: 01GCSJW391QVSC80GYDH7E93Q6 + name: My Tesla CO record + updated_at: "2022-09-15T21:07:03Z" + updated_by_user_id: "10001" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 + - created_at: "2022-09-26T22:24:15Z" + created_by_user_id: "123123" + custom_object_fields: + make: Honda + model: Civic + custom_object_key: car + external_id: null + id: 01GDXYD7ZTWYP542BA8MDDTE36 + name: My Tesla CO record2 + updated_at: "2022-09-26T22:24:15Z" + updated_by_user_id: "245159" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36 + links: + next: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/search?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query= + prev: null + meta: + after_cursor: eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0= + before_cursor: null + has_more: true + CustomObjectRecordsUpsertRequestExample: + value: + custom_object_record: + custom_object_fields: + make: Oldsmobile + model: Cutlass Supreme + name: 1997 Cutlass Supreme + CustomObjectRecordsUpsertResponseExample: + value: + custom_object_record: + created_at: "2023-09-26T22:25:10Z" + created_by_user_id: "10001" + custom_object_fields: + make: Oldsmobile + model: Cutlass Supreme + custom_object_key: car + external_id: X90001 + id: 01GDXYEY1FQYN066VHF49YHJ21 + name: 1997 Cutlass Supreme + updated_at: 2023-09-26T22:25:10Z + updated_by_user_id: "10001" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21 + CustomObjectsCreateRequestExample: + value: + custom_object: + key: apartment + title: Apartment + title_pluralized: Apartments + CustomObjectsCreateResponseExample: + value: + custom_object: + created_at: "2022-09-02T22:44:35Z" + created_by_user_id: "16485" + description: The list of cars in our fleet + include_in_list_view: true + key: car + raw_description: '{{dc.car_description}}' + raw_title: '{{dc.car_title}}' + raw_title_pluralized: '{{dc.car_title_plural}}' + title: Car + title_pluralized: Cars + updated_at: 2022-09-02T22:44:35Z + updated_by_user_id: "10234" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/01GC0617DV48CAXK6WA4DW51HD + CustomObjectsLimitResponseExample: + value: + count: 19 + limit: 50 + CustomObjectsResponseExample: + value: + custom_objects: + - created_at: "2022-09-02T22:44:35Z" + created_by_user_id: "16485" + description: The list of cars in our fleet + include_in_list_view: true + key: car + raw_description: '{{dc.car_description}}' + raw_title: '{{dc.car_title}}' + raw_title_pluralized: '{{dc.car_title_plural}}' + title: Car + title_pluralized: Cars + updated_at: 2022-09-02T22:44:35Z + updated_by_user_id: "10234" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/01GC0617DV48CAXK6WA4DW51HD + - created_at: 2022-08-01T22:44:35Z + created_by_user_id: "123123" + description: The list of vessels in our fleet + include_in_list_view: true + key: vessel + raw_description: '{{dc.vessel_description}}' + raw_title: '{{dc.vessel_title}}' + raw_title_pluralized: '{{dc.vessel_title_plural}}' + title: Vessel + title_pluralized: Vessel + updated_at: 2022-09-02T22:44:35Z + updated_by_user_id: "251251" + url: https://{subdomain}.zendesk.com/api/v2/custom_objects/01GC9TXVMNT6VHB5GBGAR09WPF + CustomRoleResponseExample: + value: + custom_role: + configuration: + assign_tickets_to_any_group: false + chat_access: true + end_user_list_access: full + end_user_profile_access: readonly + explore_access: edit + forum_access: readonly + forum_access_restricted_content: false + group_access: true + light_agent: false + macro_access: full + manage_business_rules: true + manage_contextual_workspaces: false + manage_dynamic_content: false + manage_extensions_and_channels: true + manage_facebook: false + manage_organization_fields: false + manage_ticket_fields: false + manage_ticket_forms: false + manage_user_fields: false + moderate_forums: false + organization_editing: false + organization_notes_editing: false + report_access: none + side_conversation_create: true + ticket_access: within-groups + ticket_comment_access: none + ticket_deletion: false + ticket_editing: true + ticket_merge: false + ticket_tag_editing: true + twitter_search_access: true + user_view_access: readonly + view_access: full + view_deleted_tickets: false + voice_access: true + voice_dashboard_access: false + created_at: "2012-03-12T16:32:22Z" + description: sample description + id: 10127 + name: sample role + role_type: 0 + team_member_count: 10 + updated_at: "2012-03-12T16:32:22Z" + CustomRolesResponseExample: + value: + custom_roles: + - configuration: + assign_tickets_to_any_group: false + chat_access: true + end_user_list_access: full + end_user_profile_access: readonly + explore_access: edit + export_views: false + forum_access: readonly + forum_access_restricted_content: false + group_access: true + light_agent: false + macro_access: full + manage_business_rules: true + manage_contextual_workspaces: false + manage_dynamic_content: false + manage_extensions_and_channels: true + manage_facebook: false + manage_organization_fields: false + manage_ticket_fields: false + manage_ticket_forms: false + manage_user_fields: false + moderate_forums: false + organization_editing: false + organization_notes_editing: false + report_access: none + side_conversation_create: true + ticket_access: within-groups + ticket_comment_access: none + ticket_deletion: false + ticket_editing: true + ticket_merge: false + ticket_tag_editing: true + twitter_search_access: true + user_view_access: readonly + view_access: full + view_deleted_tickets: false + voice_access: true + voice_dashboard_access: false + created_at: "2012-03-12T16:32:22Z" + description: Advisors manage the workflow and configure the help desk. They create or manage automations, macros, triggers, views, and SLA targets. They also set up channels and extensions. Advisors don't solve tickets, they can only make private comments. + id: 16 + name: Advisor + role_type: 0 + team_member_count: 10 + updated_at: "2012-03-12T16:32:22Z" + - configuration: + assign_tickets_to_any_group: false + chat_access: true + end_user_list_access: full + end_user_profile_access: readonly + explore_access: edit + export_views: true + forum_access: readonly + forum_access_restricted_content: false + group_access: true + light_agent: false + macro_access: full + manage_business_rules: true + manage_contextual_workspaces: false + manage_dynamic_content: false + manage_extensions_and_channels: true + manage_facebook: false + manage_organization_fields: false + manage_ticket_fields: false + manage_ticket_forms: false + manage_user_fields: false + moderate_forums: false + organization_editing: false + organization_notes_editing: false + report_access: none + side_conversation_create: true + ticket_access: within-groups + ticket_comment_access: none + ticket_deletion: false + ticket_editing: true + ticket_merge: false + ticket_tag_editing: true + twitter_search_access: true + user_view_access: readonly + view_access: full + view_deleted_tickets: false + voice_access: true + voice_dashboard_access: false + created_at: "2011-07-20T04:31:29Z" + description: A Staff agent's primary role is to solve tickets. They can edit tickets within their groups, view reports, and add or edit personal views and macros. + id: 6 + name: Staff + role_type: 0 + team_member_count: 10 + updated_at: "2012-02-02T10:32:59Z" + CustomStatusCreateRequestExample: + value: + custom_status: + active: true + agent_label: Responding quickly + description: Customer needs a response quickly + end_user_description: Your ticket is being responded to + end_user_label: Urgent processing + status_category: open + CustomStatusResponseExample: + value: + custom_status: + active: true + agent_label: Responding quickly + created_at: 2021-07-20T22:55:29Z + default: false + description: Customer needs a response quickly + end_user_description: Your ticket is being responded to + end_user_label: Urgent processing + id: 35436 + raw_agent_label: Responding quickly + raw_description: Customer needs a response quickly + raw_end_user_description: Your ticket is being responded to + raw_end_user_label: Urgent processing + status_category: open + updated_at: 2021-07-20T22:55:29Z + CustomStatusUpdateRequestExample: + value: + custom_status: + active: true + agent_label: Responding quickly + description: Customer needs a response quickly + end_user_description: Your ticket is being responded to + end_user_label: Urgent processing + CustomStatusesResponseExample: + value: + custom_statuses: + - active: true + agent_label: Responding quickly + created_at: 2021-07-20T22:55:29Z + default: false + description: Customer needs a response quickly + end_user_description: Your ticket is being responded to + end_user_label: Urgent processing + id: 35436 + raw_agent_label: Responding quickly + raw_description: Customer needs a response quickly + raw_end_user_description: Your ticket is being responded to + raw_end_user_label: Urgent processing + status_category: open + updated_at: 2021-07-20T22:55:29Z + CustomTicketFieldOptionCreateResponseExample: + value: + custom_field_option: + allow_solving: true + id: 10002 + name: Grapes + position: 2 + raw_name: Grapes + url: http://{subdomain}.zendesk.com/api/v2/ticket_fields/1/options/10002 + value: grape + CustomTicketFieldOptionResponseExample: + value: + custom_field_option: + allow_solving: true + id: 10001 + name: Bananas + position: 1 + raw_name: Bananas + url: http://{subdomain}.zendesk.com/api/v2/ticket_fields/1/options/10001 + value: banana + CustomTicketFieldOptionUpdateResponseExample: + value: + custom_field_option: + allow_solving: true + id: 10002 + name: Pineapples + position: 2 + raw_name: Pineapples + url: http://{subdomain}.zendesk.com/api/v2/ticket_fields/1/options/10002 + value: pineapple + CustomTicketFieldOptionsResponseExample: + value: + count: 2 + custom_field_options: + - allow_solving: true + id: 10000 + name: Apples + position: 0 + raw_name: Apples + url: http://{subdomain}.zendesk.com/api/v2/ticket_fields/1/options/10000 + value: apple + - allow_solving: true + id: 10001 + name: Bananas + position: 1 + raw_name: Bananas + url: http://{subdomain}.zendesk.com/api/v2/ticket_fields/1/options/10001 + value: banana + next_page: null + previous_page: null + CustomUserFieldOptionCreateResponseExample: + value: + custom_field_option: + id: 10002 + name: Grapes + position: 2 + raw_name: Grapes + url: http://{subdomain}.zendesk.com/api/v2/user_fields/1/options/10002 + value: grape + CustomUserFieldOptionResponseExample: + value: + custom_field_option: + id: 10001 + name: Bananas + position: 1 + raw_name: Bananas + url: http://{subdomain}.zendesk.com/api/v2/user_fields/1/options/10001 + value: banana + CustomUserFieldOptionUpdateResponseExample: + value: + custom_field_option: + id: 10002 + name: Pineapples + position: 2 + raw_name: Pineapples + url: http://{subdomain}.zendesk.com/api/v2/user_fields/1/options/10002 + value: pineapple + CustomUserFieldOptionsResponseExample: + value: + count: 2 + custom_field_options: + - id: 10000 + name: Apples + position: 0 + raw_name: Apples + url: http://{subdomain}.zendesk.com/api/v2/user_fields/1/options/10000 + value: apple + - id: 10001 + name: Bananas + position: 1 + raw_name: Bananas + url: http://{subdomain}.zendesk.com/api/v2/user_fields/1/options/10001 + value: banana + next_page: null + previous_page: null + DefinitionsResponseExample: + value: + definitions: + conditions_all: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: false + title: Closed + value: closed + conditions_any: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: false + title: Closed + value: closed + DeleteUserResponseExample: + value: + user: + active: false + id: 9873843 + name: Roger Wilco II + DeletedUserResponseExample: + value: + deleted_user: + active: false + created_at: "2019-08-26T02:10:24Z" + email: david@email.com + id: 189304711533 + locale: en-US + locale_id: 1 + name: David + organization_id: 360000000008 + phone: null + photo: null + role: end-user + shared_phone_number: null + time_zone: Eastern Time (US & Canada) + updated_at: "2019-08-26T02:10:27Z" + url: https://{subdomain}.zendesk.com/api/v2/deleted_users/189304711533 + DeletedUsersCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 13 + DeletedUsersResponseExample: + value: + deleted_users: + - active: false + created_at: "2019-08-26T02:10:24Z" + email: david@gmail.com + id: 189304711533 + locale: en-US + locale_id: 1 + name: David + organization_id: 12312312 + phone: null + photo: null + role: end-user + shared_phone_number: null + time_zone: Eastern Time (US & Canada) + updated_at: "2019-08-26T02:10:27Z" + url: https://{subdomain}.zendesk.com/api/v2/deleted_users/189304711533 + - active: false + created_at: "2019-08-26T02:10:28Z" + email: linda@gmail.com + id: 12204720593 + locale: en-US + locale_id: 1 + name: Linda + organization_id: 123123123 + phone: null + photo: null + role: end-user + shared_phone_number: null + time_zone: Eastern Time (US & Canada) + updated_at: "2019-08-26T02:10:29Z" + url: https://{subdomain}.zendesk.com/api/v2/deleted_users/12204720593 + DynamicContentResponseExample: + value: + item: + created_at: "2015-05-13T22:33:12Z" + default_locale_id: 1 + id: 47 + name: Snowboard Problem + outdated: false + placeholder: '{{dc.snowboard_problem}}' + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47 + variants: + - active: true + content: Voici mon contenu dynamique en français + created_at: "2015-05-13T22:33:12Z" + default: true + id: 47 + locale_id: 16 + outdated: false + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47/variants/47 + - active: true + content: Este es mi contenido dinámico en español + created_at: "2015-05-13T22:33:12Z" + default: false + id: 48 + locale_id: 2 + outdated: false + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47/variants/48 + DynamicContentUpdateResponseExample: + value: + item: + created_at: "2015-05-13T22:33:12Z" + default_locale_id: 1 + id: 47 + name: New name + outdated: false + placeholder: '{{dc.snowboard_problem}}' + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47 + variants: + - active: true + content: Voici mon contenu dynamique en français + created_at: "2015-05-13T22:33:12Z" + default: true + id: 47 + locale_id: 16 + outdated: false + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47/variants/47 + - active: true + content: Este es mi contenido dinámico en español + created_at: "2015-05-13T22:33:12Z" + default: false + id: 48 + locale_id: 2 + outdated: false + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47/variants/48 + DynamicContentVariantResponseExample: + value: + variant: + active: true + content: C'est mon contenu dynamique en français + created_at: "2014-04-09T19:53:23Z" + default: false + id: 23 + locale_id: 127 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + DynamicContentVariantUpdateResponseExample: + value: + variant: + active: false + content: C'est mon contenu dynamique en français + created_at: "2014-04-09T19:53:23Z" + default: false + id: 23 + locale_id: 125 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + DynamicContentVariantsCreateManyResponseExample: + value: + variants: + - active: true + content: C'est mon contenu dynamique en français + created_at: "2014-04-09T19:53:23Z" + default: false + id: 23 + locale_id: 127 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + - active: true + content: Este es mi contenido dinámico en español + created_at: "2014-04-09T19:53:23Z" + default: false + id: 24 + locale_id: 126 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/24 + DynamicContentVariantsResponseExample: + value: + variants: + - active: true + content: This is my dynamic content in English + created_at: "2014-04-09T19:53:23Z" + default: true + id: 23 + locale_id: 125 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + - active: false + content: Este es mi contenido dinámico en español + created_at: "2014-04-09T19:53:23Z" + default: false + id: 24 + locale_id: 126 + outdated: true + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/24 + DynamicContentVariantsUpdateManyResponseExample: + value: + variants: + - active: true + content: C'est mon contenu dynamique en français + created_at: "2014-04-09T19:53:23Z" + default: false + id: 23 + locale_id: 16 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23 + - active: true + content: Este es mi contenido dinámico en español + created_at: "2014-04-09T19:53:23Z" + default: false + id: 24 + locale_id: 2 + outdated: false + updated_at: "2014-04-09T19:53:23Z" + url: https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/24 + DynamicContentsResponseExample: + value: + items: + - created_at: "2015-05-13T22:33:12Z" + default_locale_id: 1 + id: 47 + name: Snowboard Problem + outdated: true + placeholder: '{{dc.snowboard_problem}}' + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47 + variants: + - active: true + content: C'est mon contenu dynamique en français + created_at: "2015-05-13T22:33:12Z" + default: true + id: 47 + locale_id: 1 + outdated: false + updated_at: "2015-05-13T22:33:12Z" + url: https://company.zendesk.com/api/v2/dynamic_content/items/47/variants/47 + EmailNotificationResponseExample: + value: + email_notification: + comment_id: 7824075373565 + created_at: "2024-02-21T23:13:07Z" + email_id: 01HQ6Z3DE28F34XBFCYH0SRM95 + message_id: <56Z97D7G67G_65d68382aa493_4639581606f3@example.com> + notification_id: 7824075373693 + recipients: + - delivery_status: + code: 530 5.7.0 + id: 24 + message: 'Email failed to deliver. Status code: 530' + name: authentication_required + email_address: recipient1@example.com + user_id: 7612709251581 + ticket_id: 623 + updated_at: "2024-02-21T23:13:07Z" + url: https://example.zendesk.com/api/v2/email_notifications/7824075373693 + EmailNotificationsResponseExample: + value: + email_notifications: + - comment_id: 7824075373565 + created_at: "2024-02-21T23:13:07Z" + email_id: 01HQ6Z3DE28F34XBFCYH0SRM95 + message_id: <56Z97D7G67G_65d68382aa493_4639581606f3@example.com> + notification_id: 7824075373693 + recipients: + - delivery_status: + code: 530 5.7.0 + id: 24 + message: 'Email failed to deliver. Status code: 530' + name: authentication_required + email_address: recipient1@example.com + user_id: 7612709251581 + ticket_id: 623 + updated_at: "2024-02-21T23:13:07Z" + url: https://example.zendesk.com/api/v2/email_notifications/7824075373693 + - comment_id: 7975134672637 + created_at: "2024-05-16T20:15:20Z" + email_id: 01HY1GPZVDQAQK3CKWD3MFPX7Z + message_id: + notification_id: 7975134674301 + recipients: + - delivery_status: + code: 538 5.7.11 + id: 27 + message: 'Email failed to deliver. Status code: 538 5.7.11' + name: encryption_required + email_address: recipient1@example.com + user_id: 1100021780374 + - delivery_status: + code: "200" + id: 5 + message: Email was delivered. + name: delivered + email_address: recipient2@example.com + user_id: 6020924697213 + ticket_id: 626 + updated_at: "2024-05-16T20:15:20Z" + url: https://example.zendesk.com/api/v2/email_notifications/7975134674301 + - comment_id: 7975121425149 + created_at: "2024-05-16T20:15:58Z" + email_id: 01HY1GR2T8VKSPZ73TMCWAFWS3 + message_id: + notification_id: 7975121425661 + recipients: + - delivery_status: + code: "0" + id: 0 + message: No delivery response has been received. + name: none + email_address: recipient1@example.com + user_id: 1100021780374 + - delivery_status: + code: "501" + id: 8 + message: 'Recipient server rejected email. Status code: 501' + name: syntax_error_in_arguments + email_address: recipient2@example.com + user_id: 6020924697213 + ticket_id: 626 + updated_at: "2024-05-16T20:15:58Z" + url: https://example.zendesk.com/api/v2/email_notifications/7975121425661 + ErrorAttachmentTooLargeExample: + summary: Attachment too large error response + value: + description: Attachment exceeds the maximum size allowed + error: AttachmentTooLarge + ErrorAttachmentUnprocessableExample: + summary: Attachment unprocessable error response + value: + description: The uploaded file could not be processed + error: AttachmentUnprocessable + ErrorBadRequestExample: + summary: Bad request error response + value: + error: Invalid URI endpoint + ErrorFileRequiredExample: + summary: File required error response + value: + error: File is required + ErrorInternalServerExample: + summary: Internal server error response + value: + error: InternalServerError + ErrorMalwareDetectedExample: + summary: Malware detected error response + value: + description: This attachment contains malware and cannot be downloaded + error: MalwareDetected + ErrorNotFoundExample: + summary: Record not found error response + value: + error: RecordNotFound + EssentialsCardExample: + value: + object_layout: + created_at: "2022-04-02T22:55:29Z" + default: true + fields: + - id: null + zrn: zen:user:identity:email + - id: null + zrn: zen:user:field:standard:external_id + - id: null + zrn: zen:user:field:standard:iana_time_zone + - id: null + zrn: zen:user:field:standard:locale + - id: null + zrn: zen:user:field:standard:organization_id + id: null + key: zen:user + layout: essentials_card + max_count: 20 + updated_at: "2022-04-02T22:55:29Z" + EssentialsCardsExample: + value: + object_layouts: + - created_at: "2022-04-02T22:55:29Z" + default: true + fields: [ ] + id: null + key: zen:user + layout: essentials_card + max_count: 20 + updated_at: "2022-04-02T22:55:29Z" + - created_at: "2022-05-02T22:55:29Z" + default: true + fields: [ ] + id: null + key: zen:custome_object:car + layout: essentials_card + max_count: 20 + updated_at: "2022-05-02T22:55:29Z" + ExportIncrementalOrganizationsResponseExample: + value: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + organizations: + - created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: ABC198 + group_id: 1835962 + id: 4112492 + name: Groablet Enterprises + notes: donkey + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + ExportIncrementalTicketEventsResponseExample: + value: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + ticket_events: + - id: 926256957613 + instance_id: 1 + metric: agent_work_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: measure + FeaturesResponseExample: + value: + features: + agent_collision: + enabled: true + agent_display_names: + enabled: true + api_limit_200_rpm: + enabled: false + api_limit_400_rpm: + enabled: false + api_limit_700_rpm: + enabled: true + api_limit_700_rpm_legacy: + enabled: false + apps_private: + enabled: false + business_hours: + enabled: false + chat: + enabled: false + customer_satisfaction: + enabled: false + dynamic_contents: + enabled: false + explore: + enabled: true + light_agents: + enabled: false + ticket_forms: + enabled: true + user_org_fields: + enabled: true + voice: + enabled: true + GetDeletionScheduleResponseExample: + value: + deletion_schedule: + active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + created_at: "2021-07-20T22:55:29Z" + default: false + description: Delete tickets older than 1 year + id: 7772196094461 + title: some schedule + updated_at: "2021-07-20T22:55:29Z" + url: https://{some domain}.zendesk.com/api/v2/deletion_schedules/7772196094461 + GetDeletionSchedulesResponseExample: + value: + deletion_schedules: + - active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + created_at: "2021-07-20T22:55:29Z" + default: false + description: Delete tickets older than 1 year + id: 7772196094461 + title: some schedule + updated_at: "2021-07-20T22:55:29Z" + url: https://{some domain}.zendesk.com/api/v2/deletion_schedules/7772196094461 + GlobalClientResponseExample: + value: + global_client: + company: Zendesk + description: Stats Widget Global Client + id: 223443 + identifier: stats_widget + kind: public + logo_url: https://example.com/logo + name: Stats Widget + GlobalClientsResponseExample: + value: + global_clients: + - company: Zendesk + description: Stats Widget Global Client + id: 223443 + identifier: stats_widget + kind: public + logo_url: https://example.com/logo + name: Stats Widget + - company: Zendesk + description: Zendesk App Global Client + id: 8678530 + identifier: zendesk_mobile_app + kind: public + logo_url: https://example.com/logo + name: Zendesk Mobile + GlobalClientsTokenSummaryResponseExample: + value: + global_clients: + - id: 223443 + last_used_at: "2024-06-07T15:46:32Z" + tokens_count: 321 + - id: 223481 + last_used_at: "2024-08-07T15:46:32Z" + tokens_count: 123 + GroupCreateResponseExample: + value: + group: + created_at: "2009-08-26T00:07:08Z" + id: 122 + is_public: true + name: My Group + updated_at: "2010-05-13T00:07:08Z" + GroupMembershipResponseExample: + value: + group_membership: + created_at: "2012-04-03T12:34:01Z" + default: true + group_id: 88 + id: 461 + updated_at: "2012-04-03T12:34:01Z" + user_id: 72 + GroupMembershipsResponseExample: + value: + group_memberships: + - created_at: "2009-05-13T00:07:08Z" + default: true + group_id: 12 + id: 4 + updated_at: "2011-07-22T00:11:12Z" + user_id: 29 + - created_at: "2012-03-13T22:01:32Z" + default: false + group_id: 3 + id: 49 + updated_at: "2012-03-13T22:01:32Z" + user_id: 155 + GroupResponseExample: + value: + group: + created_at: "2009-08-26T00:07:08Z" + id: 122 + is_public: true + name: MCs + updated_at: "2010-05-13T00:07:08Z" + GroupSLAPoliciesResponseExample: + value: + count: 1 + group_sla_policies: + - description: For low priority tickets, the Tier 1 group will solve or reassign the ticket in one hour. + filter: + all: + - field: group_ownership_time + operator: includes + value: + - 6 + id: 01H078CBDY28BZG7P6BONY09DN + policy_metrics: + - business_hours: false + metric: group_ownership_time + priority: low + target: 3600 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/group_sla/policies/01H078CBDY28BZG7P6BONY09DN + next_page: null + previous_page: null + GroupSLAPolicyCreateResponse: + value: + group_sla_policy: + description: The group with id 6 will have to solve or reassign normal priority tickets in 30 minutes and urgent tickets in 10. + filter: + all: + - field: group_ownership_time + operator: includes + value: + - 6 + id: 01H078CBDY28BZG7P6BONY09DN + policy_metrics: + - business_hours: false + metric: group_ownership_time + priority: normal + target: 1800 + - business_hours: false + metric: group_ownership_time + priority: urgent + target: 600 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN + GroupSLAPolicyFilterDefinitionResponseExample: + value: + definitions: + all: + - group: ticket + operators: + - title: Contains at least one of the following + value: includes + - title: Contains at least none of the following + value: not_includes + title: Group ID + value: group_id + values: + list: + - title: Tier 1 + value: 6 + type: list + GroupSLAPolicyResponseExample: + value: + group_sla_policy: + description: Low priority tickets assigned to the group with id 6 will be completed or reassigned in one hour. + filter: + all: + - field: group_id + operator: includes + value: + - 6 + id: 01H078CBDY28BZG7P6BONY09DN + policy_metrics: + - business_hours: false + metric: group_ownership_time + priority: low + target: 3600 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/group_sla/policies/01H078CBDY28BZG7P6BONY09DN + GroupSLAPolicyUpdateResponse: + value: + group_sla_policy: + description: Normal priority tickets assigned to the groups 6 or 7 will be completed or reassigned in 30 minutes. + filter: + all: + - field: group_id + operator: includes + value: + - 6 + - 7 + id: 01H078CBDY28BZG7P6BONY09DN + policy_metrics: + - business_hours: false + metric: group_ownership_time + priority: normal + target: 1800 + position: 3 + title: Urgent Incidents + url: https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN + GroupUpdateResponseExample: + value: + group: + created_at: "2009-08-26T00:07:08Z" + id: 123 + is_public: false + name: Interesting Group + updated_at: "2010-05-13T00:07:08Z" + GroupsCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + GroupsResponseExample: + value: + groups: + - created_at: "2009-05-13T00:07:08Z" + id: 211 + is_public: true + name: DJs + updated_at: "2011-07-22T00:11:12Z" + - created_at: "2009-08-26T00:07:08Z" + id: 122 + is_public: true + name: MCs + updated_at: "2010-05-13T00:07:08Z" + HostMappingResponseInvalidCNAMEExample: + value: + expected_cnames: + - bar.zendesk.com + is_valid: false + reason: not_a_cname + HostMappingResponseValidExample: + value: + cname: bar.zendesk.com + is_valid: true + HostMappingResponseWrongCNAMEExample: + value: + cname: bar.zendesk.com + expected_cnames: + - bar.zendesk.com + is_valid: false + reason: google.com + IncrementalCustomObjectRecordsResponseExample: + summary: Successful incremental export of custom object records + description: Example response showing custom object records that have changed since the start time + value: + after_cursor: MTU3NjYxMzUzOS4wfHw0Njd8 + after_url: https://company.zendesk.com/api/v2/incremental/custom_objects/apartment/cursor?cursor=MTU3NjYxMzUzOS4wfHw0Njd8 + before_cursor: null + before_url: null + custom_object_records: + - created_at: "2023-01-15T10:30:00Z" + created_by_user_id: "360000000001" + custom_object_fields: + address: 123 Main Street + bathrooms: "1" + bedrooms: "2" + rent: "2500" + status: occupied + tenant_email: tenant@example.com + unit_number: 12A + custom_object_key: apartment + external_id: apt-12a-main-st + id: 01HXAMPLE123456789 + name: Apartment 12A + updated_at: "2023-01-15T14:45:00Z" + updated_by_user_id: "360000000001" + url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HXAMPLE123456789 + - created_at: "2023-01-10T08:15:00Z" + created_by_user_id: "360000000002" + custom_object_fields: + address: 456 Oak Avenue + bathrooms: "1" + bedrooms: "1" + rent: "1800" + status: vacant + tenant_email: null + unit_number: 5B + custom_object_key: apartment + external_id: apt-5b-oak-ave + id: 01HXAMPLE987654321 + name: Apartment 5B + updated_at: "2023-01-16T09:20:00Z" + updated_by_user_id: "360000000003" + url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HXAMPLE987654321 + - created_at: "2023-01-05T12:00:00Z" + created_by_user_id: "360000000001" + custom_object_fields: + address: '[DELETED]' + bathrooms: '[DELETED]' + bedrooms: '[DELETED]' + rent: '[DELETED]' + status: '[DELETED]' + tenant_email: '[DELETED]' + unit_number: '[DELETED]' + custom_object_key: apartment + external_id: '[DELETED]' + id: 01HXAMPLE555666777 + name: '[DELETED]' + updated_at: "2023-01-16T16:30:00Z" + updated_by_user_id: "360000000001" + url: https://company.zendesk.com/api/v2/custom_objects/apartment/records/01HXAMPLE555666777 + filter: + exclude_deleted: false + meta: + has_more: true + IncrementalSkillBasedRoutingAttributeValuesExample: + value: + attribute_values: + - attribute_id: 15821cba-7326-11e8-b07e-950ba849aa27 + id: 19ed17fb-7326-11e8-b07e-9de44e7e7f20 + name: English + time: "2018-06-19T01:33:26Z" + type: create + count: 1200 + end_time: 1533266020 + next_page: https://{subdomain}.zendesk.com/api/v2/incremental/routing/attribute_values?cursor=7d724c71-3911-11e8-9621-836b8c683dc6 + IncrementalSkillBasedRoutingAttributesExample: + value: + attributes: + - id: 15821cba-7326-11e8-b07e-950ba849aa27 + name: Languages + time: "2018-06-19T01:33:19Z" + type: create + count: 1200 + end_time: 1533266020 + next_page: https://{subdomain}.zendesk.com/api/v2/incremental/routing/attributes?cursor=7d724c71-3911-11e8-9621-836b8c683dc6 + IncrementalSkillBasedRoutingInstanceValuesExample: + value: + count: 1200 + end_time: 1533266020 + instance_values: + - attribute_value_id: 19ed17fb-7326-11e8-b07e-9ab44e7e7f28 + id: 62055cad-7326-11e8-b07e-73653560136b + instance_id: "10001" + time: "2019-06-19T01:35:27Z" + type: associate_agent + - attribute_value_id: 19ed17fb-7326-11e8-b07e-9ab44e7e7f28 + id: 62055cad-7326-11e8-b07e-cf1082b7e6d4 + instance_id: "11375" + time: "2019-06-19T01:35:27Z" + type: associate_agent + - attribute_value_id: 19ed17fb-7326-11e8-b07e-9ab44e7e7f28 + id: 62055cad-7326-11e8-b07e-5b8483a47e24 + instance_id: "14187" + time: "2020-11-14T16:32:22Z" + type: unassociate_agent + next_page: https://{subdomain}.zendesk.com/api/v2/incremental/routing/instance_values?cursor=62055cad-7326-11e8-b07e-73653560136b + ItamAssetBulkJobRequestExample: + value: + job: + action: create + items: + - asset_type_id: 01K9BW852KHGF59W0TM02J2F6H + custom_field_values: + manufacturer: Apple + model: MacBookPro18,1 + name: Laptop 1 + status_id: 01K9BW8DD6Z2N7TXM313N8BR69 + - asset_type_id: 01K9BW852KHGF59W0TM02J2F6H + custom_field_values: + manufacturer: Dell + model: XPS 15 + name: Laptop 2 + status_id: 01K9BW8DD6Z2N7TXM313N8BR69 + ItamAssetBulkJobResponseExample: + value: + job_status: + id: V3-291e720c98aef4d953563ab090486213 + message: null + progress: null + results: null + status: queued + total: 2 + url: https://{subdomain}.zendesk.com/api/v2/job_statuses/V3-291e720c98aef4d953563ab090486213 + ItamAssetCreateRequestExample: + value: + asset: + asset_type_id: 01K9BW852KHGF59W0TM02J2F6H + custom_field_values: + ip_address: 1.2.3.4 + name: Laptop 1 + notes: Replacing a laptop for someone + status_id: 01K9BW8DD6Z2N7TXM313N8BR69 + ItamAssetFieldCreateRequestExample: + value: + field: + description: Name of the asset provider partner + key: partner_name + position: 3 + title: Partner Name + type: text + ItamAssetFieldResponseExample: + value: + field: + active: true + created_at: "2025-10-22T21:08:45Z" + description: IMEI + id: 9230426027902 + key: imei + position: 9999 + raw_description: '{{zd.itam_mobile_field_imei}}' + raw_title: '{{zd.itam_mobile_field_imei}}' + regexp_for_validation: null + system: false + title: IMEI + type: text + updated_at: "2025-10-22T21:08:45Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K86W1EC23VPWFVR2XJVK7HED/fields/9230426027902 + ItamAssetLocationCreateRequestExample: + value: + location: + external_id: NASH3F + name: Nashville Office - 3rd floor + ItamAssetLocationResponseExample: + value: + location: + created_at: "2025-11-06T05:39:35Z" + external_id: null + id: 01KBFYA07WHH5R0HF94PNW1XFV + name: San Francisco Office + updated_at: "2025-12-02T09:29:26Z" + ItamAssetLocationsIndexResponseExample: + value: + links: + next: https://{subdomain}.zendesk.com/api/v2/it_asset_management/locations?page%5Bafter%5D=eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsT00wUkxVMWRYTTFSWk1WWTFWRlJVVUZSQ1FnIn0 + prev: null + locations: + - created_at: "2025-12-02T16:34:42Z" + external_id: null + id: 01KBFYN3WBM7201APTQ07SW036 + name: Miami Office + updated_at: "2025-12-02T16:34:42Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/locations/01KBFYN3WBM7201APTQ07SW036 + - created_at: "2025-12-02T16:34:42Z" + external_id: null + id: 01KBFYN3DKSWW3TY1V5TTTPTBB + name: San Francisco Office + updated_at: "2025-12-02T16:34:42Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/locations/01KBFYN3DKSWW3TY1V5TTTPTBB + meta: + after_cursor: eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsT00wUkxVMWRYTTFSWk1WWTFWRlJVVUZSQ1FnIn0 + before_cursor: null + has_more: true + ItamAssetResponseExample: + value: + asset: + asset_tag: loaner-ABC123XYZ + asset_type_id: 01K9BT5X0115ZVH1X6T37WYMTE + created_at: "2025-11-06T05:28:57Z" + custom_field_values: + compliance_state: null + cpu_type: null + device_ownership_type: null + encryption_status: null + enrollment_status: null + firmware_version: null + free_storage: null + ip_address: 1.1.1.1 + last_sign_in_timestamp: null + last_sync_timestamp: null + mac_address: null + managed: "yes" + operating_system: null + os_version: null + ram_total: 24Gb + storage_capacity: 1Tb + udid: null + external_id: null + id: 01K9BT7CVRJWP65442BWWCYAKV + location_id: null + manufacturer: null + model: null + name: My Laptop + notes: Replacement out of cycle + organization_id: null + purchase_cost: 999.99 + purchase_date: "2025-11-03" + serial_number: ABC123XYZ + status_id: 01K9BT5XE82QS5DG58F4J8WQWY + updated_at: "2025-11-06T05:39:35Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV + user_id: null + vendor: null + warranty_expiration: "2026-11-03" + ItamAssetStatusResponseExample: + value: + status: + created_at: "2025-11-06T05:28:00Z" + external_id: null + id: 01K9BT5XE82QS5DG58F4J8WQWY + name: Available + updated_at: "2025-11-06T05:28:00Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/statuses/01K9BT5XE82QS5DG58F4J8WQWY + ItamAssetStatusesIndexResponseExample: + value: + statuses: + - created_at: "2025-11-06T05:28:00Z" + external_id: null + id: 01K9BT5XE82QS5DG58F4J8WQWY + name: Available + updated_at: "2025-11-06T05:28:00Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/statuses/01K9BT5XE82QS5DG58F4J8WQWY + - created_at: "2025-11-06T05:28:01Z" + external_id: null + id: 01K9BT5XGEVP3TGTZDZK14YZJQ + name: Retired + updated_at: "2025-11-06T05:28:01Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/statuses/01K9BT5XGEVP3TGTZDZK14YZJQ + - created_at: "2025-11-06T05:28:02Z" + external_id: null + id: 01K9BT5XHKM2N4P6Q8R0S2T4V6 + name: Under Repair + updated_at: "2025-11-06T05:28:02Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/statuses/01K9BT5XHKM2N4P6Q8R0S2T4V6 + ItamAssetTypeCreateRequestExample: + value: + asset_type: + name: Tablet + parent_id: 01K9BX5R6EAV3CH1J560S8SKHR + ItamAssetTypeFieldsIndexResponseExample: + value: + fields: + - active: true + created_at: "2025-10-22T21:08:45Z" + description: IMEI + id: 9230426027902 + key: imei + position: 9999 + raw_description: '{{zd.itam_mobile_field_imei}}' + raw_title: '{{zd.itam_mobile_field_imei}}' + regexp_for_validation: null + system: false + title: IMEI + type: text + updated_at: "2025-10-22T21:08:45Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K86W1EC23VPWFVR2XJVK7HED/fields/9230426027902 + - active: true + created_at: "2025-10-22T21:08:45Z" + description: Phone number + id: 9230441335166 + key: phone_number + position: 9999 + raw_description: '{{zd.itam_mobile_field_phone_number}}' + raw_title: '{{zd.itam_mobile_field_phone_number}}' + regexp_for_validation: null + system: false + title: Phone number + type: text + updated_at: "2025-10-22T21:08:45Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K86W1EC23VPWFVR2XJVK7HED/fields/9230441335166 + ItamAssetTypeResponseExample: + value: + asset_type: + description: null + external_id: null + field_keys: + - imei + - phone_number + hierarchy_depth: 2 + id: 01K9BT5X539BKC8SEF430HAJHJ + name: Mobile + parent_id: 01K9BT5SXPR60963HJVPWTZQHD + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K9BT5X539BKC8SEF430HAJHJ + ItamAssetTypesIndexResponseExample: + value: + asset_types: + - description: null + external_id: null + field_keys: + - imei + - phone_number + hierarchy_depth: 2 + id: 01K9BT5X539BKC8SEF430HAJHJ + name: Mobile + parent_id: 01K9BT5SXPR60963HJVPWTZQHD + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K9BT5X539BKC8SEF430HAJHJ + - description: null + external_id: null + field_keys: [ ] + hierarchy_depth: 2 + id: 01K9BT5X2VZQH191VYA3GQN7NY + name: Desktop + parent_id: 01K9BT5SXPR60963HJVPWTZQHD + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K9BT5X2VZQH191VYA3GQN7NY + - description: null + external_id: null + field_keys: [ ] + hierarchy_depth: 2 + id: 01K9BT5X0115ZVH1X6T37WYMTE + name: Laptop + parent_id: 01K9BT5SXPR60963HJVPWTZQHD + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K9BT5X0115ZVH1X6T37WYMTE + - description: null + external_id: hardware + field_keys: + - last_sync_timestamp + - operating_system + - os_version + - ip_address + - mac_address + - storage_capacity + - free_storage + - enrollment_status + - udid + - encryption_status + - device_ownership_type + - managed + - compliance_state + - cpu_type + - ram_total + - firmware_version + - last_sign_in_timestamp + hierarchy_depth: 1 + id: 01K9BT5SXPR60963HJVPWTZQHD + name: Hardware + parent_id: 01K9BT5SQ70KHAKHDCDR0C5EB6 + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/asset_types/01K9BT5SXPR60963HJVPWTZQHD + ItamAssetsIndexResponseExample: + value: + assets: + - asset_tag: loaner-ABC123XYZ + asset_type_id: 01K9BT5X0115ZVH1X6T37WYMTE + created_at: "2025-11-06T05:28:57Z" + custom_field_values: + compliance_state: null + cpu_type: null + device_ownership_type: null + encryption_status: null + enrollment_status: null + firmware_version: null + free_storage: null + ip_address: 1.1.1.1 + last_sign_in_timestamp: null + last_sync_timestamp: null + mac_address: null + managed: "yes" + operating_system: null + os_version: null + ram_total: 24Gb + storage_capacity: 1Tb + udid: null + external_id: null + id: 01K9BT7CVRJWP65442BWWCYAKV + location_id: null + manufacturer: null + model: null + name: My Laptop + notes: Replacement out of cycle + organization_id: null + purchase_cost: 999.99 + purchase_date: "2025-11-03" + serial_number: ABC123XYZ + status_id: 01K9BT5XE82QS5DG58F4J8WQWY + updated_at: "2025-11-06T05:39:35Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV + user_id: null + vendor: null + warranty_expiration: "2026-11-03" + - asset_tag: null + asset_type_id: 01K9BT5X2VZQH191VYA3GQN7NY + created_at: "2025-11-06T05:29:19Z" + custom_field_values: + compliance_state: null + cpu_type: null + device_ownership_type: null + encryption_status: null + enrollment_status: null + firmware_version: null + free_storage: null + ip_address: null + last_sign_in_timestamp: null + last_sync_timestamp: null + mac_address: null + managed: null + operating_system: null + os_version: null + ram_total: null + storage_capacity: null + udid: null + external_id: null + id: 01K9BT82RZTDJ2V0MH3SG8ET4A + location_id: null + manufacturer: null + model: null + name: My Desktop + notes: null + organization_id: null + purchase_cost: null + purchase_date: null + serial_number: null + status_id: 01K9BT5XGEVP3TGTZDZK14YZJQ + updated_at: "2025-11-06T05:29:19Z" + url: https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT82RZTDJ2V0MH3SG8ET4A + user_id: null + vendor: null + warranty_expiration: null + links: + next: https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets?page%5Bafter%5D=eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0 + prev: null + meta: + after_cursor: eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0 + before_cursor: null + has_more: true + JobStatusBulkDeleteResponseExample: + value: + job_status: + id: 82de0b044094f0c67893ac9fe64f1a99 + message: Completed at 2018-03-08 10:07:04 +0000 + progress: 2 + results: + - action: delete + id: 244 + status: Deleted + success: true + - action: delete + id: 245 + status: Deleted + success: true + status: completed + total: 2 + url: https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99 + JobStatusResponseExample: + value: + job_status: + id: 82de0b044094f0c67893ac9fe64f1a99 + message: Completed at 2018-03-08 10:07:04 +0000 + progress: 2 + results: + - action: update + id: 244 + status: Updated + success: true + - action: update + id: 245 + status: Updated + success: true + status: completed + total: 2 + url: https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99 + JobStatusesResponseExample: + value: + job_statuses: + - id: 8b726e606741012ffc2d782bcb7848fe + status: completed + - id: e7665094164c498781ebe4c8db6d2af5 + status: completed + ListDeletedTicketsResponseExample: + value: + count: 1 + deleted_tickets: + - actor: + id: 3946 + name: Taz Wombat + deleted_at: 20140704T15:37:04Z + id: 581 + previous_state: open + subject: Wombat Party + next_page: null + previous_page: null + ListTicketCollaboratorsResponseExample: + value: + users: + - id: 223443 + name: Johnny Agent + - id: 8678530 + name: Peter Admin + ListTicketEmailCCsResponseExample: + value: + users: + - id: "223443" + name: Johnny Agent + - id: "8678530" + name: Peter Admin + - id: "6748530" + name: Jane End User + ListTicketFollowersResponseExample: + value: + users: + - id: 223443 + name: Johnny Agent + - id: 8678530 + name: Peter Admin + ListTicketIncidentsResponseExample: + value: + tickets: + - description: The fire is very colorful. + id: 33 + status: open + subject: My printer is on fire + - description: The fire is very colorful as well! + id: 34 + status: pending + subject: The printer is on fire over here too + ListTicketProblemsResponseExample: + value: + tickets: + - custom_status_id: 123 + description: The fire is very colorful. + id: 33 + status: open + subject: My printer is on fire + - custom_status_id: 231 + description: The fire is very colorful as well! + id: 34 + status: pending + subject: The printer is on fire over here too + LocaleDetectBestLanguageResponseExample: + value: + locale: + created_at: "2010-12-23T12:45:22Z" + id: 1 + locale: en + name: English + updated_at: "2012-04-01T10:44:12Z" + url: https://company.zendesk.com/api/v2/locales/en-US + LocaleResponseExample: + value: + locale: + created_at: "2010-12-23T12:45:22Z" + id: 8 + locale: de + name: Deutsch + updated_at: "2012-04-01T10:44:12Z" + url: https://company.zendesk.com/api/v2/locales/de + LocalesResponseExample: + value: + locales: + - created_at: "2009-07-20T22:55:29Z" + id: 1 + locale: en-US + name: English + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/locales/en-US + - created_at: "2010-12-23T12:45:22Z" + id: 8 + locale: de + name: Deutsch + updated_at: "2012-04-01T10:44:12Z" + url: https://company.zendesk.com/api/v2/locales/de + MacroActionsResponseExample: + value: + actions: + - group: ticket + operators: + - title: Is + value: is + output_key: null + target: null + title: Set subject + title_for_field: Set subject + value: subject + values: + list: [ ] + type: text + - group: ticket + operators: + - title: Is + value: is + output_key: null + target: null + title: Status + title_for_field: Set subject + value: subject + values: + list: + - enabled: true + title: Open + value: open + - enabled: true + title: Pending + value: pending + - enabled: true + title: Solved + value: solved + type: list + - field: priority + group: ticket + operators: + - title: Is + value: is + output_key: null + title: Priority + title_for_field: Priority + value: priority + values: + list: + - enabled: false + title: Low + value: low + - enabled: true + title: Normal + value: normal + - enabled: true + title: High + value: high + - enabled: false + title: Urgent + value: urgent + type: list + MacroAttachmentResponseExample: + value: + macro_attachment: + content_type: image/jpeg + content_url: https://company.zendesk.com/api/v2/macros/attachments/100/content + created_at: "2016-08-15T16:04:06Z" + filename: foobar.jpg + id: 100 + size: 2532 + MacroAttachmentsResponseExample: + value: + macro_attachments: + - content_type: image/jpeg + content_url: https://company.zendesk.com/api/v2/macros/attachments/100/content + created_at: "2016-08-15T16:04:06Z" + filename: foobar.jpg + id: 100 + size: 2532 + - content_type: image/jpeg + content_url: https://company.zendesk.com/api/v2/macros/attachments/342/content + created_at: "2016-08-16T12:42:25Z" + filename: bazbat.jpg + id: 342 + size: 5028 + MacroCategoriesResponseExample: + value: + categories: + - FAQ + - Triage + MacroChangesToTicketsResponseExample: + value: + result: + ticket: + assignee_id: 235323 + comment: + body: Assigned to Agent Uno. + public: false + scoped_body: + - - channel:all + - Assigned to Agent Uno. + fields: + id: 27642 + value: "745" + group_id: 98738 + MacroResponseExample: + value: + macro: + actions: [ ] + active: true + description: Sets the ticket status to `solved` + id: 25 + position: 42 + restriction: { } + title: Close and Save + MacrosResponseExample: + value: + count: 2 + macros: + - actions: [ ] + active: true + description: Sets the ticket status to `solved` + id: 25 + position: 42 + restriction: { } + title: Close and Save + - actions: [ ] + active: false + description: Adds a `priority` tag to the ticket + id: 26 + restriction: { } + title: Assign priority tag + next_page: null + previous_page: null + ManySkillBasedRoutingAttributeValuesErrorExample: + value: + error: + message: 'You passed an invalid value for the filter attribute. Invalid parameter: filter must be present from api/v2/routing/instance_values/show_many_agent_instance_values' + title: Invalid attribute + ManySkillBasedRoutingAttributeValuesResponseExample: + value: + count: 2 + instance_values: + - agent_id: 224 + agent_skill_priority: NORMAL + attribute_id: 2e39fa8e-d88b-11ef-9229-e3c997c52841 + attribute_value_id: 89137a1a-13e5-415a-8417-beb03e7c043e + created_at: 2025-01-23T02:24:00Z + id: f969d6c9-f3ba-4928-9046-2c006928c1b7 + name: french + updated_at: 2025-01-23T02:24:00Z + - agent_id: 225 + agent_skill_priority: HIGH + attribute_id: 384b95cd-e59b-4dc0-9d94-a6a76d98fb3f + attribute_value_id: 32ae7078-b763-441d-bc2e-5a632a0283ec + created_at: 2025-01-23T02:24:00Z + id: 19ebcf64-306f-4982-b4a9-325c6d2fecfe + name: french + updated_at: 2025-01-23T02:24:00Z + next_page: null + previous_page: null + MergeEndUsersRequestExample: + value: + user: + id: 35436 + MergeUserWithCurrentUserRequestExample: + value: + user: + email: roge@example.org + password: foo1234 + MergeUserWithCurrentUserResponseExample: + value: + user: + id: 9873843 + name: Roger Wilco + OAuthClientResponseExample: + value: + client: + company: Zendesk + created_at: "2009-05-13T00:07:08Z" + description: Zendesk Test Client + id: 223443 + identifier: test_client + name: Test Client + redirect_uri: + - https://example.com/callback + secret: af3t24tfj34h43s... + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/clients/223443 + user_id: 29 + OAuthClientUpdateResponseExample: + value: + client: + company: Zendesk + created_at: "2009-05-13T00:07:08Z" + description: Zendesk Test Client + id: 223443 + identifier: test_client + name: My New OAuth2 Client + redirect_uri: + - https://example.com/callback + secret: af3t24tfj34h43s... + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/clients/223443 + user_id: 29 + OAuthClientsResponseExample: + value: + clients: + - company: Zendesk + created_at: "2009-05-13T00:07:08Z" + description: Zendesk Test Client + id: 223443 + identifier: test_client + name: Stats Widget + redirect_uri: + - https://example.com/callback + secret: af3t24tfj34h43s... + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/clients/223443 + user_id: 29 + - company: Zendesk + created_at: "2009-05-13T00:07:08Z" + description: Zendesk Mobile Client + id: 8678530 + identifier: mobile_client + name: Zendesk Mobile + redirect_uri: + - https://example.com/callback + secret: af3t24tfj34h43s... + updated_at: "2011-07-22T00:11:12Z" + url: https://example.zendesk.com/api/v2/clients/8678530 + user_id: 29 + OAuthTokenForGrantTypesResponseExample: + value: + access_token: gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo + scope: organizations:write read + token_type: bearer + OAuthTokenResponseExample: + value: + token: + client_id: 1234 + created_at: "2009-05-13T00:07:08Z" + expires_at: "2011-07-22T00:11:12Z" + id: 223443 + refresh_token: af3t24tfj34h43s... + scopes: + - read + - write + token: af3345kdj3 + url: https://example.zendesk.com/api/v2/tokens/223443 + used_at: "2010-01-22T00:11:12Z" + user_id: 29 + OAuthTokensResponseExample: + value: + tokens: + - client_id: 41 + created_at: "2009-05-13T00:07:08Z" + expires_at: "2011-07-22T00:11:12Z" + id: 223443 + refresh_token: af3t24tfj34h43s... + scopes: + - read + token: af3345kdj3 + url: https://example.zendesk.com/api/v2/tokens/223443 + used_at: "2010-01-22T00:11:12Z" + user_id: 29 + - client_id: 41 + created_at: "2009-05-13T00:07:08Z" + expires_at: "2011-07-22T00:11:12Z" + id: 8678530 + refresh_token: af3t24tfj34h43s... + scopes: + - read + token: 34hjgkjas4 + url: https://example.zendesk.com/api/v2/tokens/8678530 + used_at: "2010-01-22T00:11:12Z" + user_id: 29 + ObjectTriggerBulkUpdateRequestExample: + value: + triggers: + - id: 25 + position: 1 + - active: false + id: 26 + ObjectTriggerDefinitionResponseExample: + value: + definitions: + actions: + - group: custom_object + nullable: true + repeatable: false + subject: custom_object.order.custom_fields.due + title: due + type: date + values: + - enabled: true + format: date + title: Set to a specific date + value: specific_date + - enabled: true + format: text + title: Set to a number of days from now + value: days_from_now + - group: custom_object + nullable: true + repeatable: false + subject: custom_object.order.custom_fields.fulfilled + title: Fulfilled + type: list + values: + - enabled: true + title: Checked + value: "true" + - enabled: true + title: Unchecked + value: "false" + - group: custom_object + nullable: true + repeatable: false + subject: custom_object.order.custom_fields.heat + title: heat + type: text + - group: custom_object + nullable: true + repeatable: false + subject: custom_object.order.custom_fields.miles + title: miles + type: text + conditions_all: + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: update_type + title: Order + type: list + values: + - enabled: true + title: Created + value: Create + - enabled: true + title: Updated + value: Change + - group: custom_object + nullable: false + operators: + - format: date + terminal: false + title: Is + value: is + - format: date + terminal: false + title: Is not + value: is_not + - format: date + terminal: true + title: Present + value: present + - format: date + terminal: true + title: Not present + value: not_present + - format: date + terminal: false + title: Before + value: less_than + - format: date + terminal: false + title: Before or on + value: less_than_equal + - format: date + terminal: false + title: After + value: greater_than + - format: date + terminal: false + title: After or on + value: greater_than_equal + - format: integer + terminal: false + title: Is within the previous + value: within_previous_n_days + - format: integer + terminal: false + title: Is within the next + value: within_next_n_days + repeatable: false + subject: custom_object.order.custom_fields.due + title: due + type: date + - group: custom_object + nullable: true + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: custom_object.order.custom_fields.fulfilled + title: Fulfilled + type: list + values: + - enabled: true + title: Checked + value: "true" + - enabled: true + title: Unchecked + value: "false" + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + - terminal: false + title: Contains at least one of the following words + value: includes_words + - terminal: false + title: Contains none of the following words + value: not_includes_words + - terminal: false + title: Contains the following string + value: includes_string + - terminal: false + title: Does not contain the following string + value: not_includes_string + repeatable: false + subject: custom_object.order.custom_fields.heat + title: heat + type: text + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Less than + value: less_than + - terminal: false + title: Less than or equal to + value: less_than_equal + - terminal: false + title: Greater than + value: greater_than + - terminal: false + title: Greater than or equal to + value: greater_than_equal + - terminal: false + title: Is not + value: is_not + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_object.order.custom_fields.miles + title: miles + type: text + conditions_any: + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: update_type + title: Order + type: list + values: + - enabled: true + title: Created + value: Create + - enabled: true + title: Updated + value: Change + - group: custom_object + nullable: false + operators: + - format: date + terminal: false + title: Is + value: is + - format: date + terminal: false + title: Is not + value: is_not + - format: date + terminal: true + title: Present + value: present + - format: date + terminal: true + title: Not present + value: not_present + - format: date + terminal: false + title: Before + value: less_than + - format: date + terminal: false + title: Before or on + value: less_than_equal + - format: date + terminal: false + title: After + value: greater_than + - format: date + terminal: false + title: After or on + value: greater_than_equal + - format: integer + terminal: false + title: Is within the previous + value: within_previous_n_days + - format: integer + terminal: false + title: Is within the next + value: within_next_n_days + repeatable: false + subject: custom_object.order.custom_fields.due + title: due + type: date + - group: custom_object + nullable: true + operators: + - terminal: false + title: Is + value: is + repeatable: false + subject: custom_object.order.custom_fields.fulfilled + title: Fulfilled + type: list + values: + - enabled: true + title: Checked + value: "true" + - enabled: true + title: Unchecked + value: "false" + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + - terminal: false + title: Contains at least one of the following words + value: includes_words + - terminal: false + title: Contains none of the following words + value: not_includes_words + - terminal: false + title: Contains the following string + value: includes_string + - terminal: false + title: Does not contain the following string + value: not_includes_string + repeatable: false + subject: custom_object.order.custom_fields.heat + title: heat + type: text + - group: custom_object + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Less than + value: less_than + - terminal: false + title: Less than or equal to + value: less_than_equal + - terminal: false + title: Greater than + value: greater_than + - terminal: false + title: Greater than or equal to + value: greater_than_equal + - terminal: false + title: Is not + value: is_not + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_object.order.custom_fields.miles + title: miles + type: text + ObjectTriggerRequestExample: + value: + trigger: + actions: + - field: custom_object.order.custom_fields.miles + value: "100" + conditions: + all: [ ] + any: + - field: custom_object.order.custom_fields.heat + operator: not_present + title: active test order trigger with any conditions + ObjectTriggerResponseExample: + value: + trigger: + actions: + - field: custom_object.order.custom_fields.miles + value: "100" + active: true + conditions: + all: [ ] + any: + - field: custom_object.order.custom_fields.heat + operator: not_present + created_at: "2024-07-08T22:34:49Z" + description: "" + id: 27 + position: 3 + raw_title: active test order trigger with any conditions + title: active test order trigger with any conditions + updated_at: "2024-07-08T22:34:49Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/27 + ObjectTriggersActiveResponseExample: + value: + count: 1 + next_page: null + previous_page: null + triggers: + - actions: [ ] + active: true + conditions: { } + created_at: "2024-06-27T16:51:54Z" + description: A trigger for custom object of type = order + id: 25 + position: 1 + raw_title: Order object trigger + title: Order object trigger + updated_at: "2024-06-27T16:51:54Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/25 + ObjectTriggersResponseExample: + value: + count: 2 + next_page: null + previous_page: null + triggers: + - actions: [ ] + active: true + conditions: { } + created_at: "2024-06-27T16:51:54Z" + description: A trigger for custom object of type = order + id: 25 + position: 1 + raw_title: Order object trigger + title: Order object trigger + updated_at: "2024-06-27T16:51:54Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/25 + - actions: [ ] + active: false + conditions: + all: + - field: custom_object.order.custom_fields.heat + operator: not_present + any: [ ] + created_at: "2024-07-08T20:44:32Z" + description: Check order's heat and set field as needed + id: 26 + position: 2 + raw_title: Set order miles when heat not present + title: Set order miles when heat not present + updated_at: "2024-07-08T20:44:32Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/26 + ObjectTriggersSearchResponseExample: + value: + count: 1 + next_page: null + previous_page: null + triggers: + - actions: + - field: custom_object.order.custom_fields.miles + value: "100" + active: true + conditions: + all: + - field: custom_object.order.custom_fields.heat + operator: is + value: "1" + any: [ ] + created_at: "2024-07-09T21:29:59Z" + description: "" + id: 28 + position: 1 + raw_title: Testing CO trigger with tagger field condition + title: Testing CO trigger with tagger field condition + updated_at: "2024-07-09T21:29:59Z" + url: http://{subdomain}.zendesk.com/api/v2/custom_objects/order/triggers/28 + OrganizationFieldCreateResponseExample: + value: + organization_field: + active: true + created_at: "2013-02-27T20:35:55Z" + description: This field describes the support plan this organization has + id: 75 + key: support_description + position: 0 + raw_description: This field describes the support plan this organization has + raw_title: Support description + regexp_for_validation: null + title: Support description + type: text + updated_at: "2013-02-27T20:35:55Z" + url: https://company.zendesk.com/api/v2/organization_fields/75 + OrganizationFieldResponseExample: + value: + organization_field: + active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/organization_fields/7 + OrganizationFieldUpdateResponseExample: + value: + organization_field: + active: true + created_at: "2013-02-27T20:35:55Z" + description: This field describes the support plan this organization has + id: 75 + key: support_description + position: 0 + raw_description: This field describes the support plan this organization has + raw_title: Support description + regexp_for_validation: null + title: Support description + type: text + updated_at: "2013-02-27T20:35:55Z" + url: https://company.zendesk.com/api/v2/organization_fields/75 + OrganizationFieldsResponseExample: + value: + count: 1 + next_page: null + organization_fields: + - active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/organization_fields/7 + previous_page: null + OrganizationMembershipCreateManyResponseExample: + value: + job_status: + id: 8b726e606741012ffc2d782bcb7848fe + message: Completed at Fri Apr 13 02:51:53 +0000 2012 + progress: 2 + results: + - action: create + id: 380 + status: Created + success: true + status: completed + total: 2 + url: https://company.zendesk.com/api/v2/job_statuses/8b726e606741012ffc2d782bcb7848fe + OrganizationMembershipCreateResponseExample: + value: + organization_membership: + created_at: "2012-04-03T12:34:01Z" + default: true + id: 461 + organization_id: 88 + updated_at: "2012-04-03T12:34:01Z" + user_id: 72 + OrganizationMembershipResponseExample: + value: + organization_membership: + created_at: "2009-05-13T00:07:08Z" + default: true + id: 4 + organization_id: 12 + updated_at: "2011-07-22T00:11:12Z" + user_id: 29 + OrganizationMembershipsResponseExample: + value: + organization_memberships: + - created_at: "2009-05-13T00:07:08Z" + default: true + id: 4 + organization_id: 12 + organization_name: first organization + updated_at: "2011-07-22T00:11:12Z" + user_id: 29 + view_tickets: true + - created_at: "2012-03-13T22:01:32Z" + default: null + id: 49 + organization_id: 3 + organization_name: second organization + updated_at: "2012-03-13T22:01:32Z" + user_id: 155 + view_tickets: true + OrganizationMergeListResponseExample: + value: + organization_merges: + - id: 01HPZM6206BF4G63783E5349AD + loser_id: 123 + status: complete + url: https://company.zendesk.com/api/v2/organization_merges/01HPZM6206BF4G63783E5349AD + winner_id: 456 + OrganizationMergeRequestExample: + value: + organization_merge: + winner_id: 54321 + OrganizationMergeResponseExample: + value: + organization_merge: + id: 01HPZM6206BF4G63783E5349AD + loser_id: 123 + status: new + url: https://company.zendesk.com/api/v2/organization_merges/01HPZM6206BF4G63783E5349AD + winner_id: 456 + OrganizationResponseExample: + value: + organization: + created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: null + group_id: 1835962 + id: 4112492 + name: Groablet Enterprises + notes: donkey + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + OrganizationSubscriptionCreateRequestExample: + value: + organization_subscription: + organization_id: 32 + user_id: 482 + OrganizationSubscriptionResponseExample: + value: + organization_subscription: + created_at: "2009-07-20T22:55:29Z" + id: 1234 + organization_id: 32 + user_id: 482 + OrganizationSubscriptionsResponseExample: + value: + organization_subscriptions: + - created_at: "2009-07-20T22:55:29Z" + id: 1234 + organization_id: 32 + user_id: 482 + - created_at: "2011-08-22T21:12:09Z" + id: 43681 + organization_id: 334 + user_id: 49471 + OrganizationsRelatedResponse: + value: + organization_related: + tickets_count: 12 + users_count: 4 + OrganizationsResponseExample: + value: + count: 2 + next_page: null + organizations: + - created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: ABC198 + group_id: 1835962 + id: 4112492 + name: Groablet Enterprises + notes: donkey + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + - created_at: "2017-08-14T20:13:52Z" + details: test + domain_names: + - test.com + external_id: TTV273 + group_id: null + id: 1873 + name: Willy Wonkas Chocolate Factory + notes: "" + organization_fields: + datepudding: "2018-11-02T00:00:00+00:00" + org_field_1: malarky + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - teapot_kettle + updated_at: "2019-05-16T01:27:46Z" + url: https://example.zendesk.com.com/api/v2/organizations/1873 + previous_page: null + OtpSettingResponseExample: + value: + one_time_password: + configured: true + enforced: true + phone: "+18917389123" + tfa_configured: true + time_based: true + url: https://example.zendesk.com/auth/api/one_time_password + PermanentlyDeleteTicketJobStatusResponseExample: + value: + job_status: + id: 82de0b044094f0c67893ac9fe64f1a99 + message: null + progress: null + results: null + status: queued + total: null + url: https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99 + PermissionPoliciesResponseExample: + value: + policies: + - id: custom-role-6678128886399 + records: + create: + allowed: false + rule_id: null + delete: + allowed: true + rule_id: 6862342718335 + read: + allowed: true + rule_id: 6862342718335 + update: + allowed: true + rule_id: 6862342718335 + role_name: Custom Role + - id: end-user + records: + create: + allowed: true + rule_id: null + delete: + allowed: false + rule_id: null + read: + allowed: true + rule_id: null + update: + allowed: false + rule_id: null + role_name: End User + PermissionPolicyResponseExample: + value: + policy: + id: custom-role-6678128886399 + records: + create: + allowed: false + rule_id: null + delete: + allowed: false + rule_id: null + read: + allowed: true + rule_id: 6862342718335 + update: + allowed: true + rule_id: 6862342718335 + role_name: Custom Role + PermissionPolicyUpdateRequestExample: + value: + policy: + records: + create: + allowed: false + rule_id: null + delete: + allowed: false + rule_id: null + read: + allowed: true + rule_id: 6862342718335 + update: + allowed: true + rule_id: 6862342718335 + PushNotificationDevicesRequestExample: + value: + push_notification_devices: + - token1 + - token2 + QueueCreateResponseExample: + value: + queue: + created_at: "2023-11-27T09:03:59Z" + definition: + all: + - field: priority + operator: is + value: urgent + any: [ ] + description: Queue description + id: 01HG80ATNNZK1N7XRFVKX48XD6 + name: New queue with valid definition + order: 1 + primary_groups: + count: 2 + groups: + - id: 6784729637757 + name: EW + - id: 5399674286077 + name: test + priority: 1 + secondary_groups: + count: 0 + groups: [ ] + updated_at: "2023-11-27T09:03:59Z" + url: https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6 + QueueResponseExample: + value: + queue: + created_at: "2023-11-27T09:03:59Z" + definition: + all: + - field: priority + operator: is + value: urgent + any: [ ] + description: Queue description + id: 01HG80ATNNZK1N7XRFVKX48XD6 + name: New queue with valid definition + order: 1 + primary_groups: + count: 2 + groups: + - id: 6784729637757 + name: EW + - id: 5399674286077 + name: test + priority: 1 + secondary_groups: + count: 0 + groups: [ ] + updated_at: "2023-11-27T09:03:59Z" + url: https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6 + QueuesResponseExample: + value: + queues: + - created_at: "2023-11-27T09:03:59Z" + definition: + all: + - field: priority + operator: is + value: urgent + any: [ ] + description: Queue description + id: 01HG80ATNNZK1N7XRFVKX48XD6 + name: New queue with valid definition + order: 1 + primary_groups: + count: 2 + groups: + - id: 6784729637757 + name: EW + - id: 5399674286077 + name: test + priority: 1 + secondary_groups: + count: 0 + groups: [ ] + updated_at: "2023-11-27T09:03:59Z" + url: https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6 + QueuesUpdateResponseExample: + value: + queue: + created_at: "2023-09-27T09:06:34Z" + definition: + all: + - field: priority + operator: is + value: urgent + any: [ ] + description: Queue description 2 + id: 01HG80ATNNZK1N7XRFVKX48XD6 + name: New queue 2 + order: 1 + primary_groups: + count: 1 + groups: + - id: 1100002759994 + name: Sales + priority: 10 + secondary_groups: + count: 1 + groups: + - id: 4398063790591 + name: Support + updated_at: "2023-10-13T10:58:25Z" + url: https://{subdomain}.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6 + RecoverSuspendedTicketResponseExample: + value: + ticket: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + RecoverSuspendedTicketUnprocessableContentResponseExample: + value: + ticket: + - author: + email: help@example.com + id: 1 + name: Help + brand_id: 123 + cause: Received from support address + cause_id: 22 + content: Your request has been received and is being reviewed by our support staff. + created_at: "2023-04-06T20:51:31Z" + error_messages: null + id: 14668816692628 + message_id: + recipient: support@example.support.com + subject: Received from support address + ticket_id: 14668816692628 + updated_at: "2023-04-06T20:51:31Z" + url: https://example.zendesk.com/api/v2/tickets/14668816692628 + via: + channel: email + source: + from: + address: help@example.com, + name: Help + rel: null + to: + address: support@example.zendesk.com + name: Support, + RecoverSuspendedTicketsResponseExample: + value: + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 3436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 3437 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + RelationshipFilterDefinitionExample: + value: + definitions: + conditions_all: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: false + title: Less than + value: less_than + - terminal: false + title: Greater than + value: greater_than + - terminal: true + title: Changed + value: changed + - terminal: false + title: Changed to + value: value + - terminal: false + title: Changed from + value: value_previous + - terminal: true + title: Not changed + value: not_changed + - terminal: false + title: Not changed to + value: not_value + - terminal: false + title: Not changed from + value: not_value_previous + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: New + value: new + - enabled: true + title: Open + value: open + - enabled: true + title: Pending + value: pending + - enabled: true + title: Solved + value: solved + - enabled: true + title: Closed + value: closed + - group: custom_object + nullable: true + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + - terminal: false + title: Matches + value: matches + - terminal: false + title: Does not match + value: not_matches + repeatable: false + subject: custom_object.apartment.custom_fields.brand + title: Assigned Brand + type: autocomplete + values: + - enabled: true + title: (ticket's brand) + value: ticket_brand_id + conditions_any: + - group: ticket + nullable: true + operators: + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_fields_20513432 + title: Happy Gilmore + type: list + - group: ticket + nullable: true + operators: + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_fields_86492341 + title: total_time_field + type: list + RemoteAuthenticationsResponseExample: + value: + remote_authentications: + - agent: false + agent_primary: false + auth_mode: 3 + auth_mode_name: jwt + can_display_button_to_end_users: false + can_display_button_to_team_members: false + end_user: true + end_user_primary: false + id: 1234 + ip_ranges: null + is_active: true + label: MyJWT + masked_secret: 16egqn****************************************** + name: JWT Provider + priority: 1 + remote_login_url: https://example.com/jwt/login + remote_logout_url: https://example.zendesk.com/jwt/logout + update_external_ids: false + - agent: false + agent_primary: false + auth_mode: 2 + auth_mode_name: saml + can_display_button_to_end_users: false + can_display_button_to_team_members: false + end_user: false + end_user_primary: false + fingerprint: asdfghasdfgasdfgasdfgasdfgasdfgasdfgasdfg + id: 5678 + ip_ranges: null + is_active: false + label: MySAML + name: SAML Provider + priority: 2 + remote_login_url: https://example.com/saml/login + remote_logout_url: https://example.zendesk.com/saml/logout + - agent: false + agent_primary: false + auth_flow: PKCE + auth_mode: 4 + auth_mode_name: oidc + auth_url: https://example.com/auth + auto_discovery: false + can_display_button_to_end_users: true + can_display_button_to_team_members: true + client_id: abcdef + end_user: false + end_user_primary: false + id: 9012 + ip_ranges: null + is_active: false + issuer_url: https://example.com/issuer + jwks_url: https://example.com/jwks + label: MyOIDC + masked_client_secret: SRT2hj****************************************** + name: OIDC + priority: 1 + remote_login_url: "" + remote_logout_url: "" + scope: openid email + token_url: https://example.com/token + user_info_url: https://example.com/user + RenewSessionResponseExample: + value: + authenticity_token: huU19Z76zNC9Yvt+i9p7MviIOlOIg/JWqEdf6nGmnu9JInV04fksCIdtNDvoYAoV + RequestCreateResponseExample: + value: + request: + custom_status_id: 1 + description: My printer is on fire! + id: 33 + status: new + subject: Help! + RequestGetCommentResponseExample: + value: + comment: + body: Thanks! + id: 43 + RequestListCommentsResponseExample: + value: + comments: + - body: Thanks for your help + id: 43 + RequestResponseExample: + value: + request: + custom_status_id: 123 + description: My printer is on fire! + id: 33 + status: open + subject: Help! + RequestUserCreateRequestExample: + value: + user: + email: roge@example.org + name: Roger Wilco + RequestsResponseExample: + value: + requests: + - custom_status_id: 123 + description: My printer is on fire! + id: 33 + status: open + subject: Help! + - custom_status_id: 234 + description: I can't find my keys + id: 34 + status: closed + subject: Help! + ResourceCollectionCreateResponseExample: + value: + job_status: + id: 0a3e49b038c40133d7380242ac110031 + message: null + progress: null + results: null + status: queued + total: null + url: https://company.zendesk.com/api/v2/job_statuses/0a3e49b038c40133d7380242ac110031 + ResourceCollectionDeleteResponseExample: + value: + job_status: + id: 2ee570d0398e0133e26e0242ac110017 + message: null + progress: null + results: null + status: queued + total: null + url: https://company.zendesk.com/api/v2/job_statuses/2ee570d0398e0133e26e0242ac110017 + ResourceCollectionResponseExample: + value: + resource_collection: + created_at: "2015-09-09T01:57:24Z" + id: 10002 + resources: + - deleted: false + identifier: email_on_ticket_solved + resource_id: 10824486485524 + type: triggers + - deleted: false + identifier: support_description + resource_id: 10824486482580 + type: ticket_fields + updated_at: "2015-09-09T01:57:24Z" + ResourceCollectionUpdateResponseExample: + value: + job_status: + id: 4555831038d20133d7390242ac110031 + message: null + progress: null + results: null + status: queued + total: null + url: https://company.zendesk.com/api/v2/job_statuses/4555831038d20133d7390242ac110031 + ResourceCollectionsResponseExample: + value: + count: 0 + next_page: null + previous_page: null + resource_collections: + - created_at: "2015-09-09T01:57:24Z" + id: 10002 + resources: + - deleted: false + identifier: email_on_ticket_solved + resource_id: 10824486485524 + type: triggers + - deleted: false + identifier: support_description + resource_id: 10824486482580 + type: ticket_fields + updated_at: "2015-09-09T01:57:24Z" + - created_at: "2015-09-10T02:01:03Z" + id: 10002 + resources: + - deleted: false + identifier: an_email_target + resource_id: 10827267902996 + type: targets + updated_at: "2015-09-10T02:02:15Z" + ReverseLookupUsersResponseExample: + value: + users: + - id: 223443 + name: Johnny Agent + - id: 8678530 + name: James A. Rosen + SLAPoliciesResponseExample: + value: + count: 1 + next_page: null + previous_page: null + sla_policies: + - description: For urgent incidents, we will respond to tickets in 10 minutes + filter: + all: + - field: type + operator: is + value: incident + - field: via_id + operator: is + value: "4" + any: [ ] + id: 36 + policy_metrics: + - business_hours: false + metric: first_reply_time + priority: low + target: 60 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/slas/policies/36 + SLAPolicyCreateResponse: + value: + sla_policy: + description: For urgent incidents, we will respond to tickets in 10 minutes + filter: + all: + - field: type + operator: is + value: incident + any: [ ] + id: 36 + policy_metrics: + - business_hours: false + metric: first_reply_time + priority: normal + target: 30 + - business_hours: false + metric: first_reply_time + priority: urgent + target: 10 + - business_hours: false + metric: requester_wait_time + priority: low + target: 180 + - business_hours: false + metric: requester_wait_time + priority: normal + target: 160 + - business_hours: false + metric: requester_wait_time + priority: high + target: 140 + - business_hours: false + metric: requester_wait_time + priority: urgent + target: 120 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/slas/policies/36 + SLAPolicyFilterDefinitionResponseExample: + value: + definitions: + all: + - group: ticket + operators: + - title: Is + value: is + - title: Is not + value: is_not + target: null + title: Brand + value: brand_id + values: + list: + - title: Support + value: "10001" + type: list + any: + - group: ticket + operators: + - title: Is + value: is + - title: Is not + value: is_not + target: null + title: Brand + value: brand_id + values: + list: + - title: Support + value: "10001" + type: list + SLAPolicyResponseExample: + value: + sla_policy: + description: For urgent incidents, we will respond to tickets in 10 minutes + filter: + all: + - field: type + operator: is + value: incident + - field: via_id + operator: is + value: "4" + any: [ ] + id: 36 + policy_metrics: + - business_hours: false + metric: first_reply_time + priority: low + target: 60 + position: 3 + title: Incidents + url: https://{subdomain}.zendesk.com/api/v2/slas/policies/36 + SLAPolicyUpdateResponse: + value: + sla_policy: + description: For urgent incidents, we will resolve the ticket within 2 hours + filter: + all: + - field: type + operator: is + value: incident + any: [ ] + id: 36 + policy_metrics: + - business_hours: false + metric: first_reply_time + priority: normal + target: 30 + - business_hours: false + metric: first_reply_time + priority: urgent + target: 10 + - business_hours: false + metric: requester_wait_time + priority: low + target: 180 + - business_hours: false + metric: requester_wait_time + priority: normal + target: 160 + - business_hours: false + metric: requester_wait_time + priority: high + target: 140 + - business_hours: false + metric: requester_wait_time + priority: urgent + target: 120 + position: 3 + title: Urgent Incidents + url: https://{subdomain}.zendesk.com/api/v2/slas/policies/36 + SatisfactionRatingResponseExample: + value: + satisfaction_rating: + - assignee_id: 135 + comment: Awesome support! + created_at: "2011-07-20T22:55:29Z" + group_id: 44 + id: 35436 + requester_id: 7881 + score: good + ticket_id: 208 + updated_at: "2011-07-20T22:55:29Z" + url: https://example.zendesk.com/api/v2/satisfaction_ratings/35436 + SatisfactionRatingsCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + SatisfactionRatingsResponseExample: + value: + satisfaction_ratings: + - assignee_id: 135 + comment: Awesome support! + created_at: "2011-07-20T22:55:29Z" + group_id: 44 + id: 35436 + requester_id: 7881 + score: good + ticket_id: 208 + updated_at: "2011-07-20T22:55:29Z" + url: https://example.zendesk.com/api/v2/satisfaction_ratings/35436 + - assignee_id: 136 + comment: Awesome support! + created_at: "2012-02-01T04:31:29Z" + group_id: 44 + id: 120447 + requester_id: 7881 + score: good + ticket_id: 209 + updated_at: "2012-02-02T10:32:59Z" + url: https://example.zendesk.com/api/v2/satisfaction_ratings/120447 + SatisfactionReasonResponseExample: + value: + reason: + - created_at: "2011-07-20T22:55:29Z" + id: 35121 + raw_value: '{{dc.reason_code_1000}}' + reason_code: 1000 + updated_at: "2011-07-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/satisfaction_reason/35121 + value: Agent did not respond quickly. + SatisfactionReasonsResponseExample: + value: + reasons: + - created_at: "2011-07-20T22:55:29Z" + id: 35436 + raw_value: '{{dc.reason_code_1000}}' + reason_code: 1000 + updated_at: "2011-07-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/satisfaction_reasons/35436 + value: Agent did not respond quickly. + - created_at: "2011-07-20T22:55:29Z" + id: 120447 + raw_value: '{{dc.reason_code_1000}}' + reason_code: 1001 + updated_at: "2011-07-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/satisfaction_reasons/120447 + value: Issue is not resolved. + SearchCountResponseExample: + value: + count: 6 + SearchExportResponseExample: + value: + facets: null + links: + next: https://example.zendesk.com/api/v2/search/export?filter%5Btype%5D=ticket&page%5Bafter%5D=eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ%3D%3D&page%5Bsize%5D=100&query=hello%26page%5Bsize%5D%3D100%26filter%5Btype%5D%3Dticket + prev: null + meta: + after_cursor: eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ== + before_cursor: null + has_more: true + results: [ ] + SearchResponseExample: + value: + count: 1234 + facets: null + next_page: https://foo.zendesk.com/api/v2/search?query="type:Group hello"&sort_by=created_at&sort_order=desc&page=2 + previous_page: null + results: + - created_at: "2009-05-13T00:07:08Z" + id: 211 + name: Hello DJs + result_type: group + updated_at: "2011-07-22T00:11:12Z" + url: https://foo.zendesk.com/api/v2/groups/211 + - created_at: "2009-08-26T00:07:08Z" + id: 122 + name: Hello MCs + result_type: group + updated_at: "2010-05-13T00:07:08Z" + url: https://foo.zendesk.com/api/v2/groups/122 + SearchUsersResponseExample: + value: + users: + - id: 35436 + name: Robert Jones + notes: sigil issue + - id: 9873843 + name: Terry Gilliam + SecuritySettingsResponseExample: + value: + security_settings: + admins_can_set_user_passwords: false + agent_session_timeout: 480 + assumable: true + assumable_account_type: false + assumption_duration: day + assumption_expiration: "2025-10-10T12:12:12Z" + authentication: + agent: + enforce_sso: false + google_login: false + office_365_allowed_tids: "" + office_365_enforce_tid: false + office_365_login: false + password: + disallow_local_part_from_email: false + failed_attempts_allowed: 10 + is_available: true + max_sequence: null + password_complexity: 0 + password_duration: 0 + password_history_length: 0 + password_in_mixed_case: false + password_length: 5 + primary_external_auth: null + remote_bypass: 2 + remote_bypass_name: admins + remote_login: false + security_policy_id: 350 + security_policy_name: recommended + sso_auto_redirect: false + zendesk_login: true + end_user: + enforce_sso: false + facebook_login: false + google_login: false + office_365_login: false + primary_external_auth: null + remote_login: false + security_policy_id: 350 + security_policy_name: recommended + sso_auto_redirect: false + twitter_login: false + zendesk_login: true + csp_blocking_enabled: true + email_agent_when_sensitive_fields_changed: true + end_user_session_timeout: 480 + ip: + enable_agent_ip_restrictions: false + ip_ranges: 127.0.0.1 127.0.0.2 + ip_restriction_enabled: true + maximum_session_duration: 720 + maximum_session_duration_enabled: true + mobile_app_access: true + mobile_app_session_timeout: 300 + two_factor_last_update: "2025-09-08T18:12:19Z" + SessionResponseExample: + value: + session: + - authenticated_at: "2014-11-18T17:24:29Z" + id: 3432 + last_seen_at: "2014-11-18T17:30:52Z" + url: https://company.zendesk.com/api/v2/users/12345/sessions/3432 + user_id: 12345 + SessionsResponseExample: + value: + sessions: + - authenticated_at: "2014-11-18T17:24:29Z" + id: 3432 + last_seen_at: "2014-11-18T17:30:52Z" + url: https://company.zendesk.com/api/v2/users/12345/sessions/3432 + user_id: 12345 + SharingAgreementCreateResponseExample: + value: + sharing_agreement: + created_at: "2012-02-20T22:55:29Z" + id: 1 + name: Foo @ Zendesk + partner_name: null + remote_subdomain: foo + status: accepted + type: inbound + updated_at: "2013-02-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/agreements/1 + SharingAgreementResponseExample: + value: + sharing_agreement: + created_at: "2012-02-20T22:55:29Z" + id: 1 + name: Foo @ Zendesk + partner_name: null + remote_subdomain: foo + status: accepted + type: inbound + updated_at: "2013-02-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/agreements/1 + SharingAgreementUpdateResponseExample: + value: + sharing_agreement: + created_at: "2012-02-20T22:55:29Z" + id: 1 + name: Foo @ Zendesk + partner_name: null + remote_subdomain: foo + status: accepted + type: inbound + updated_at: "2013-02-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/agreements/1 + SharingAgreementsResponseExample: + value: + sharing_agreements: + - created_at: "2012-02-20T22:55:29Z" + id: 1 + name: Foo @ Zendesk + partner_name: jira + status: accepted + type: inbound + updated_at: "2013-02-20T22:55:29Z" + url: https://company.zendesk.com/api/v2/agreements/1 + ShowDerivedMacroResponseExample: + value: + definitions: + actions: + - group: ticket + nullable: false + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: Open + value: "1" + - enabled: true + title: Pending + value: "2" + - enabled: true + title: Solved + value: "3" + - enabled: true + title: Closed + value: "4" + ShowJobStatusResponseExample: + value: + job_status: + id: 8b726e606741012ffc2d782bcb7848fe + message: Completed at Fri Apr 13 02:51:53 +0000 2012 + progress: 2 + results: + - action: update + id: 380 + status: Updated + success: true + status: completed + total: 2 + url: https://company.zendesk.com/api/v2/job_statuses/8b726e606741012ffc2d782bcb7848fe + ShowManyUsersResponseExample: + value: + users: + - id: 345678 + name: Johnny Appleseed + - id: 901234 + name: Rupert Root + SkillBasedRoutingAttributeCreateResponseExample: + value: + attribute: + created_at: "2018-11-15T23:44:45Z" + id: 6e279587-e930-11e8-a292-09cfcdea1b75 + name: Language + updated_at: "2018-11-15T23:44:45Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/6e279587-e930-11e8-a292-09cfcdea1b75 + SkillBasedRoutingAttributeDefinitionsExample: + value: + definitions: + conditions_all: + - subject: number_of_incidents + title: Number of incidents + conditions_any: + - subject: brand + title: Brand + SkillBasedRoutingAttributeResponseExample: + value: + attribute: + created_at: "2018-11-15T23:44:45Z" + id: 6e279587-e930-11e8-a292-09cfcdea1b75 + name: Language + updated_at: "2018-11-15T23:44:45Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/6e279587-e930-11e8-a292-09cfcdea1b75 + SkillBasedRoutingAttributeUpdateResponseExample: + value: + attribute: + created_at: "2018-11-15T23:44:45Z" + id: 6e279587-e930-11e8-a292-09cfcdea1b75 + name: Lingua + updated_at: "2018-11-15T23:44:45Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/6e279587-e930-11e8-a292-09cfcdea1b75 + SkillBasedRoutingAttributeValueCreateResponseExample: + value: + attribute_value: + created_at: "2018-11-08T19:22:58Z" + id: 6ccddacf-e85e-11e8-a292-ad7686bdff67 + name: Japanese + updated_at: "2018-11-08T19:22:58Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/afa31619-e38b-11e8-a292-5d17513d969b/values/6ccddacf-e85e-11e8-a292-ad7686bdff67 + SkillBasedRoutingAttributeValueResponseExample: + value: + attribute_value: + created_at: "2018-11-08T19:22:58Z" + id: b376b35a-e38b-11e8-a292-e3b6377c5575 + name: French + updated_at: "2018-11-08T19:22:58Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/afa31619-e38b-11e8-a292-5d17513d969b/values/b376b35a-e38b-11e8-a292-e3b6377c5575 + SkillBasedRoutingAttributeValueUpdateResponseExample: + value: + attribute_value: + created_at: "2018-11-14T22:41:28Z" + id: b376b35a-e38b-11e8-a292-e3b6377c5575 + name: German (Advanced) + updated_at: "2018-11-14T22:45:01Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/afa31619-e38b-11e8-a292-5d17513d969b/values/b376b35a-e38b-11e8-a292-e3b6377c5575 + SkillBasedRoutingAttributeValuesResponseExample: + value: + attribute_values: + - agent_skill_priority: NORMAL + created_at: "2018-11-08T19:22:58Z" + id: b376b35a-e38b-11e8-a292-e3b6377c5575 + name: French + updated_at: "2018-11-08T19:22:58Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/afa31619-e38b-11e8-a292-5d17513d969b/values/b376b35a-e38b-11e8-a292-e3b6377c5575 + SkillBasedRoutingAttributeValuesWithoutPriorityResponseExample: + value: + attribute_values: + - created_at: "2018-11-08T19:22:58Z" + id: b376b35a-e38b-11e8-a292-e3b6377c5575 + name: French + updated_at: "2018-11-08T19:22:58Z" + url: https://{subdomain}.zendesk.com/api/v2/routing/attributes/afa31619-e38b-11e8-a292-5d17513d969b/values/b376b35a-e38b-11e8-a292-e3b6377c5575 + SkillBasedRoutingAttributesResponseExample: + value: + attributes: + - created_at: "2017-12-01T19:29:31Z" + id: 15821cba-7326-11e8-b07e-950ba849aa27 + name: Color + updated_at: "2017-12-01T19:29:31Z" + count: 1 + next_page: null + previous_page: null + SkillBasedRoutingTicketAttributesResponseExample: + value: + attribute_values: + - attribute_id: f4a604b1-d6cd-11e7-a492-657e7928664c + created_at: "2017-12-01T19:29:41Z" + id: fa1131e2-d6cd-11e7-a492-dbdd5500c7e3 + name: ocean + updated_at: "2017-12-01T19:35:45Z" + SkillBasedRoutingTicketFulfilledResponseExample: + value: + fulfilled_ticket_ids: + - 1 + - 17 + SupportAddressCreateResponseExample: + value: + recipient_address: + brand_id: 123 + cname_status: verified + created_at: "2017-04-02T22:55:29Z" + default: false + email: help@example.zendesk.com + forwarding_status: waiting + id: 33 + name: Sales + spf_status: verified + updated_at: "2017-04-02T22:55:29Z" + SupportAddressResponseExample: + value: + recipient_address: + brand_id: 123 + cname_status: unknown + created_at: "2017-04-02T22:55:29Z" + default: true + email: help@example.zendesk.com + forwarding_status: waiting + id: 33 + name: Sales + spf_status: unknown + updated_at: "2017-04-02T22:55:29Z" + SupportAddressUpdateResponseExample: + value: + recipient_address: + brand_id: 123 + created_at: "2017-04-02T22:55:29Z" + default: true + email: name2@example.com + forwarding_status: verified + id: 33 + name: Sales + updated_at: "2017-05-02T22:55:29Z" + SupportAddressesResponseExample: + value: + recipient_addresses: + - brand_id: 123 + cname_status: verified + created_at: "2015-07-20T22:55:29Z" + default: true + domain_verification_status: verified + email: sales@example.zendesk.com + forwarding_status: unknown + id: 33 + name: Sales + spf_status: verified + updated_at: "2016-09-21T20:15:20Z" + - brand_id: 123 + cname_status: verified + created_at: "2015-07-20T22:55:29Z" + default: false + domain_verification_status: verified + email: marketing@example.zendesk.com + forwarding_status: unknown + id: 34 + name: Marketing + spf_status: verified + updated_at: "2016-09-21T20:15:20Z" + SuspendedTicketResponseExample: + value: + suspended_ticket: + - author: + email: styx@example.com + id: 1 + name: Mr. Roboto + brand_id: 123 + cause: Detected as spam + content: Out Of Office Reply + created_at: "2009-07-20T22:55:29Z" + id: 3436 + recipient: john@example.com + subject: Help I need somebody! + ticket_id: 67321 + updated_at: "2011-05-05T10:38:52Z" + url: https://example.zendesk.com/api/v2/tickets/35436 + via: + channel: web + SuspendedTicketsAttachmentsResponseExample: + value: + upload: + attachments: + - content_type: application/ics + content_url: https://company.zendesk.com/attachments/token/tyBq1ms40dFaHefSIigxZpwGg/?name=calendar.ics + file_name: calendar.ics + id: 367 + size: 1166 + thumbnails: [ ] + url: https://company.zendesk.com/api/v2/attachments/367 + token: yrznqgjoa24iw2f + SuspendedTicketsExportResponseExample: + value: + export: + status: enqueued + view_id: suspended + SuspendedTicketsResponseExample: + value: + suspended_tickets: + - attachments: [ ] + author: + email: styx@example.com + id: 1 + name: Mr. Roboto + brand_id: 123 + cause: Detected as spam + cause_id: 0 + content: Out Of Office Reply + created_at: "2009-07-20T22:55:29Z" + error_messages: null + id: 435 + message_id: Spambot@spam.co.evil + recipient: john@example.com + subject: Help, my printer is on fire! + ticket_id: 67321 + updated_at: "2011-05-05T10:38:52Z" + url: https://example.zendesk.com/api/v2/tickets/35436 + via: + channel: email + source: + from: + address: totallylegit@emailaddress.com + name: TotallyLegit + rel: null + to: + address: support@example.zendesk.com + name: Example Account + - attachments: [ ] + author: + email: styx@example.com + id: 1 + name: Mr. Roboto + brand_id: 123 + cause: Automated response mail + cause_id: 0 + content: Out Of Office Reply + created_at: "2009-07-20T22:55:29Z" + error_messages: null + id: 207623 + message_id: Spambot@spam.co.evil + recipient: john@example.com + subject: Not just anybody! + ticket_id: 67321 + updated_at: "2011-05-05T10:38:52Z" + url: https://example.zendesk.com/api/v2/tickets/35436 + via: + channel: email + source: + from: + address: totallylegit@emailaddress.com + name: TotallyLegit + rel: null + to: + address: support@example.zendesk.com + name: Example Account + TagCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + TagsAutocompleteResponseExample: + value: + tags: + - attention + - attack + TagsByObjectIdResponse: + value: + tags: + - urgent + - printer + - fire + TagsRemoveResponseExample: + value: + tags: + - tag1 + TagsResponseExample: + value: + count: 1 + next_page: null + previous_page: null + tags: + - count: 10 + name: Triage + TargetCreateResponseExample: + value: + target: + active: true + created_at: "2009-05-13T00:07:08Z" + email: hello@example.com + subject: Test Target + title: Test Email Target + type: email_target + TargetFailureResponseExample: + value: + target_failure: + id: 1 + raw_request: "GET /api/v2/tickets HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ..." + raw_response: "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ..." + status_code: 401 + target_name: My URL Target + TargetFailuresResponseExample: + value: + target_failures: + - id: 1 + status_code: 401 + target_name: My URL Target + - id: 2 + status_code: 401 + target_name: My URL Target + TargetResponseExample: + value: + target: + active: true + created_at: "2009-05-13T00:07:08Z" + id: 211 + title: Fancy box + type: basecamp_target + TargetUpdateResponseExample: + value: + target: + active: true + created_at: "2009-05-13T00:07:08Z" + email: roger@example.com + subject: Test Target + title: Test Email Target + type: email_target + TargetsResponseExample: + value: + targets: + - active: true + created_at: "2009-05-13T00:07:08Z" + id: 211 + title: Fancy box + type: basecamp_target + TaskListByTicketIdResponseExample: + value: + count: 1 + next_page: null + previous_page: null + task_lists: + - created_at: "2025-08-06T17:08:40Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01K3KVF23JWZ5M98BJBQHENYZ9 + name: Onboarding checklist + task_count: 2 + task_list_template_id: 01K205PG0J2ET0B8AFHA106C1E + ticket_id: "1" + updated_at: "2025-08-06T17:08:40Z" + TaskListCreateRequestExample: + value: + task_list: + task_list_template_id: 01K205PG0J2ET0B8AFHA106C1E + TaskListTemplateCreateRequestExample: + value: + task_list_template: + description: Complete HR, IT, and payroll setup for new employees. + name: Onboarding checklist + tasks: + - description: Ensure the employee has signed and returned all required documents before proceeding. + name: Verify signed offer letter and contract + required: true + - description: Submit the background check request and verify employee eligibility before onboarding. + name: Initiate background check + TaskListTemplateResponseExample: + value: + task_list_template: + created_at: "2025-08-06T17:08:40Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01K205PG0J2ET0B8AFHA106C1E + is_active: true + name: Onboarding checklist + task_count: 2 + updated_at: "2025-08-06T17:08:40Z" + url: https://{subdomain}.zendesk.com/api/v2/task_list_templates/01K205PG0J2ET0B8AFHA106C1E.json + TaskListTemplateUpdateRequestExample: + value: + task_list_template: + name: Updating a task list template + tasks: + - description: Updating a task's description + id: 01K3KVF20JE2QNA47FY6HJWQKB + - _destroy: true + id: 01K3KVF23JWZ5M98BJBQHENYZ9 + - description: A new task + name: New task + TaskListTemplateWithItemsResponseExample: + value: + task_list_template: + created_at: "2025-08-26T18:50:21Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01K205PG0J2ET0B8AFHA106C1E + is_active: true + name: Onboarding checklist + task_count: 2 + tasks: + - created_at: "2025-08-26T18:50:21Z" + description: Ensure the employee has signed and returned all required documents before proceeding. + id: 01K3KVF20JE2QNA47FY6HJWQKB + name: Verify signed offer letter and contract + position: 1 + required: true + updated_at: "2025-08-26T18:50:21Z" + - created_at: "2025-08-26T18:50:21Z" + description: Submit the background check request and verfiy employee elgibility before onboarding. + id: 01K3KVF23JWZ5M98BJBQHENYZ9 + name: Initiate background check + position: 2 + required: false + updated_at: "2025-08-26T18:50:21Z" + updated_at: "2025-08-26T18:50:21Z" + url: https://{subdomain}.zendesk.com/api/v2/task_list_templates/01K205PG0J2ET0B8AFHA106C1E.json + TaskListTemplatesResponseExample: + value: + links: + next: https://{subdomain}.zendesk.com/api/v2/task_list_templates?page%5Bafter%5D=eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0 + prev: null + meta: + after_cursor: eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0 + before_cursor: null + has_more: true + task_list_templates: + - created_at: "2025-08-06T17:08:40Z" + description: Complete HR, IT, and payroll setup for new employees. + id: 01K205PG0J2ET0B8AFHA106C1E + is_active: true + name: Onboarding checklist + task_count: 2 + updated_at: "2025-08-06T17:08:40Z" + url: https://{subdomain}.zendesk.com/api/v2/task_list_templates/01K205PG0J2ET0B8AFHA106C1E.json + - created_at: "2025-08-06T17:08:40Z" + description: Close out access, collect all equipment, and wrap up HR steps for departing. + id: 01K3KV7834EFJPHQC2VFXKSYGN + is_active: true + name: Offboarding checklist + task_count: 3 + updated_at: "2026-01-12T18:31:19Z" + url: https://{subdomain}.zendesk.com/api/v2/task_list_templates/01K3KV7834EFJPHQC2VFXKSYGN.json + TasksByTaskListTemplateIdResponseExample: + value: + count: 2 + next_page: null + previous_page: null + tasks: + - created_at: "2025-08-26T18:50:21Z" + description: Ensure the employee has signed and returned all required documents before proceeding. + id: 01K3KVF20JE2QNA47FY6HJWQKB + name: Verify signed offer letter and contract + position: 1 + required: false + updated_at: "2025-08-26T18:50:21Z" + - created_at: "2025-08-26T18:50:21Z" + description: Submit the background check request and verfiy employee elgibility before onboarding. + id: 01K3KVF23JWZ5M98BJBQHENYZ9 + name: Initiate background check + position: 2 + required: false + updated_at: "2025-08-26T18:50:21Z" + TicketAuditResponseExample: + value: + audit: + author_id: 5246746 + created_at: "2011-09-25T22:35:44Z" + events: + - attachments: [ ] + body: This is a new private comment + html_body:

This is a new private comment

+ id: 2127301148 + public: false + type: Comment + - field_name: status + id: 2127301163 + previous_value: new + type: Change + value: open + via: + channel: rule + source: + from: + id: 22472716 + title: Assign to first responder + rel: trigger + to: { } + - field_name: custom_status_id + id: 2127301164 + previous_value: 1 + type: Change + value: 123 + via: + channel: rule + source: + from: + id: 22472716 + title: Assign to first responder + rel: trigger + to: { } + id: 2127301143 + metadata: + custom: { } + system: + client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1 + ip_address: 76.218.201.212 + location: San Francisco, CA, United States + ticket_id: 666 + via: + channel: web + TicketAuditsCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 18 + TicketAuditsForTicketResponseExample: + value: + audits: + - author_id: 5246746 + created_at: "2011-09-25T22:35:44Z" + events: + - attachments: [ ] + body: This is a new private comment + html_body:

This is a new private comment

+ id: 2127301148 + public: false + type: Comment + - field_name: status + id: 2127301163 + previous_value: new + type: Change + value: open + via: + channel: rule + source: + from: + id: 35079792 + title: Assign to first responder + rel: trigger + to: { } + - field_name: custom_status_id + id: 2127301164 + previous_value: 1 + type: Change + value: 123 + via: + channel: rule + source: + from: + id: 22472716 + title: Assign to first responder + rel: trigger + to: { } + id: 2127301143 + metadata: + custom: { } + system: + client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1 + ip_address: 76.218.201.212 + location: San Francisco, CA, United States + ticket_id: 666 + via: + channel: web + count: 1 + next_page: null + previous_page: null + TicketAuditsResponseExample: + value: + after_cursor: MTUwMTYwNzUyMi4wfHwxMzQ3NTMxNjcxfA== + after_url: https://subdomain.zendesk.com/api/v2/ticket_audits?cursor=MTUwMTYwNzUyMi4wfHwxMzQ3NTMxNjcxfA%3D%3D&limit=1000 + audits: + - author_id: 35436 + created_at: "2011-09-25T22:35:44Z" + events: + - attachments: [ ] + body: Thanks for your help! + id: 1564245 + public: true + type: Comment + - body: 'Ticket #47 has been updated' + id: 1564246 + subject: Your ticket has been updated + type: Notification + - field_name: status + id: 1564247 + previous_value: new + type: Change + value: open + - field_name: custom_status_id + id: 1564248 + previous_value: 1 + type: Change + value: 123 + id: 2127301143 + metadata: + custom: + time_spent: 3m22s + system: + ip_address: 184.106.40.75 + ticket_id: 123 + via: + channel: web + before_cursor: fDE1MDE1NzUxMjIuMHx8MTM0NzM0MzAxMQ== + before_url: https://subdomain.zendesk.com/api/v2/ticket_audits?cursor=fDE1MDE1NzUxMjIuMHx8MTM0NzM0MzAxMQ%3D%3D&limit=1000 + TicketBulkImportRequestExample: + value: + tickets: + - assignee_id: 19 + comments: + - author_id: 827 + created_at: "2009-06-25T10:15:18Z" + value: This is a comment + - author_id: 19 + public: false + value: This is a private comment + description: A description + requester_id: 827 + subject: Help + tags: + - foo + - bar + - assignee_id: 21 + comments: + - author_id: 830 + created_at: "2009-06-25T10:15:18Z" + value: This is a comment + - author_id: 21 + public: false + value: This is a private comment + description: A description + requester_id: 830 + subject: Missing Item + tags: + - foo + - bar + TicketChatCommentAttachmentRedactionResponseExample: + value: + chat_event: + id: 1932802680168 + type: ChatStartedEvent + value: + chat_id: 2109.10502823.Sjuj2YrBpXwei + history: + - chat_index: 0 + filename: redacted.txt + type: ChatFileAttachment + - chat_index: 1 + filename: redacted.txt + type: ChatFileAttachment + visitor_id: 10502823-16EkM3T6VNq7KMd + TicketChatCommentRedactionResponseExample: + value: + chat_event: + id: 1932802680168 + type: ChatStartedEvent + value: + chat_id: 2109.10502823.Sjuj2YrBpXwei + history: + - chat_index: 0 + message: My ID number is ▇▇▇▇! + type: ChatMessage + visitor_id: 10502823-16EkM3T6VNq7KMd + TicketCommentStringRedactResponseExample: + value: + comment: + author_id: 1 + id: 35436 + plain_body: My social security number is ▇▇▇▇! + type: Comment + TicketCommentsCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 12 + TicketCommentsRedactionInAgentWorkspaceResponseExample: + value: + comment: + attachments: [ ] + author_id: 123 + id: 100 + plain_body: My ID number is ▇▇▇▇! + public: true + type: Comment + TicketCommentsResponseExample: + value: + comments: + - attachments: + - content_type: text/plain + content_url: https://company.zendesk.com/attachments/crash.log + file_name: crash.log + id: 498483 + size: 2532 + thumbnails: [ ] + audit_id: 432567 + author_id: 123123 + body: Thanks for your help! + created_at: "2009-07-20T22:55:29Z" + id: 1274 + metadata: + system: + client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 + ip_address: 1.1.1.1 + latitude: -37.000000000001 + location: Melbourne, 07, Australia + longitude: 144.0000000000002 + via: + channel: web + source: + from: { } + rel: web_widget + to: { } + public: true + type: Comment + TicketContentPinExample: + value: + account_id: "124125123" + content_id: 01H04XB9F7XSYKNCCJ5BKBA1SM + content_type: external_content + created_at: "2009-07-20T22:55:29Z" + id: 01H04XAA433S53SRVPN0KKCTCZ + locale: en_US + ticket_id: "5" + url: https://{subdomain}.zendesk.com/hc/en-us/articles/34613040902417-how-to-reset-your-password + TicketContentPinsExample: + value: + count: 1 + ticket_content_pins: + - account_id: "124125123" + content_id: 01H04XB9F7XSYKNCCJ5BKBA1SM + content_type: external_content + created_at: "2009-07-20T22:55:29Z" + id: 01H04XAA433S53SRVPN0KKCTCZ + locale: en_US + ticket_id: "5" + url: https://{subdomain}.zendesk.com/hc/en-us/articles/34613040902417-how-to-reset-your-password + TicketCreateRequestExample: + value: + ticket: + comment: + body: The smoke is very colorful. + priority: urgent + subject: My printer is on fire! + TicketCreateTicketViaTalkRequestExample: + value: + display_to_agent: 1234 + ticket: + comment: + body: My printer is on fire! + priority: urgent + via_id: 46 + voice_comment: + answered_by_id: 28 + call_duration: 40 + from: "+16617480240" + location: Dublin, Ireland + recording_url: http://yourdomain.com/recordings/1.mp3 + started_at: "2019-04-16T09:14:57Z" + to: "+16617480123" + transcription_text: The transcription of the call + TicketFieldCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + TicketFieldResponseExample: + value: + ticket_field: + active: true + agent_description: Agent only description + collapsed_for_agents: false + created_at: "2012-04-02T22:55:29Z" + description: Age + editable_in_portal: false + id: 89 + position: 9999 + raw_description: Age + raw_title: Age + raw_title_in_portal: Age + regexp_for_validation: null + required: true + required_in_portal: false + tag: null + title: Age + title_in_portal: Age + type: text + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_fields/89 + visible_in_portal: false + TicketFieldUpdateResponseExample: + value: + ticket_field: + active: true + agent_description: Agent only description + collapsed_for_agents: false + created_at: "2012-04-02T22:55:29Z" + description: Your age + editable_in_portal: false + id: 89 + position: 9999 + raw_description: Your age + raw_title: Your age + raw_title_in_portal: Your age + regexp_for_validation: null + required: true + required_in_portal: false + tag: null + title: Your age + title_in_portal: Your age + type: text + updated_at: "2012-04-02T23:11:23Z" + url: https://company.zendesk.com/api/v2/ticket_fields/89 + visible_in_portal: false + TicketFieldsResponseExample: + value: + ticket_fields: + - active: true + agent_description: Agent only description + collapsed_for_agents: false + created_at: "2009-07-20T22:55:29Z" + description: This is the subject field of a ticket + editable_in_portal: true + id: 34 + position: 21 + raw_description: This is the subject field of a ticket + raw_title: '{{dc.my_title}}' + raw_title_in_portal: '{{dc.my_title_in_portal}}' + regexp_for_validation: null + required: true + required_in_portal: true + tag: null + title: Subject + title_in_portal: Subject + type: subject + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/ticket_fields/34 + visible_in_portal: true + TicketFieldsShowManyResponseExample: + value: + count: 2 + next_page: null + previous_page: null + ticket_fields: + - active: true + agent_description: Agent only description + collapsed_for_agents: false + created_at: "2009-07-20T22:55:29Z" + description: This is the subject field of a ticket + editable_in_portal: true + id: 34 + position: 21 + raw_description: This is the subject field of a ticket + raw_title: '{{dc.my_title}}' + raw_title_in_portal: '{{dc.my_title_in_portal}}' + regexp_for_validation: null + required: true + required_in_portal: true + tag: null + title: Subject + title_in_portal: Subject + type: subject + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/ticket_fields/34 + visible_in_portal: true + - active: true + agent_description: "" + collapsed_for_agents: false + created_at: "2009-07-20T22:55:29Z" + description: Request priority + editable_in_portal: false + id: 35 + position: 22 + raw_description: Request priority + raw_title: Priority + raw_title_in_portal: Priority + regexp_for_validation: null + required: false + required_in_portal: false + tag: null + title: Priority + title_in_portal: Priority + type: priority + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/ticket_fields/35 + visible_in_portal: true + TicketFormCreateResponseExample: + value: + ticket_form: + active: true + agent_conditions: + - child_fields: + - id: 44 + is_required: false + required_on_statuses: + statuses: + - new + - open + - pending + - hold + type: SOME_STATUSES + - id: 32 + is_required: true + required_on_statuses: + statuses: + - solved + type: SOME_STATUSES + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: true + required_on_statuses: + type: ALL_STATUSES + - id: 32 + is_required: false + required_on_statuses: + type: NO_STATUSES + parent_field_id: 32 + value: matching_value_2 + created_at: "2012-04-02T22:55:29Z" + default: false + deleted_at: "2012-05-02T22:55:29Z" + display_name: Snowboard Damage + end_user_conditions: + - child_fields: + - id: 32 + is_required: true + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: false + parent_field_id: 32 + value: matching_value_2 + end_user_visible: true + id: 47 + in_all_brands: false + name: Snowboard Problem + position: 9999 + raw_display_name: Snowboard Damage + raw_name: Snowboard Problem + restricted_brand_ids: + - 1 + - 4 + - 6 + - 12 + - 34 + ticket_field_ids: + - 2 + - 4 + - 5 + - 32 + - 44 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_forms/47 + TicketFormResponseExample: + value: + ticket_form: + active: true + agent_conditions: + - child_fields: + - id: 44 + is_required: false + required_on_statuses: + statuses: + - new + - open + - pending + - hold + type: SOME_STATUSES + - id: 32 + is_required: true + required_on_statuses: + statuses: + - solved + type: SOME_STATUSES + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: true + required_on_statuses: + type: ALL_STATUSES + - id: 32 + is_required: false + required_on_statuses: + type: NO_STATUSES + parent_field_id: 32 + value: matching_value_2 + created_at: "2012-04-02T22:55:29Z" + default: true + deleted_at: "2012-05-02T22:55:29Z" + display_name: Snowboard Damage + end_user_conditions: + - child_fields: + - id: 32 + is_required: true + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: false + parent_field_id: 32 + value: matching_value_2 + end_user_visible: true + id: 47 + in_all_brands: false + name: Snowboard Problem + position: 9999 + raw_display_name: '{{dc.my_display_name}}' + raw_name: Snowboard Problem + restricted_brand_ids: + - 1 + - 4 + - 6 + - 12 + - 34 + ticket_field_ids: + - 2 + - 4 + - 5 + - 32 + - 44 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_forms/47 + TicketFormStatusesResponseExample: + value: + ticket_form_statuses: + - custom_status_id: 7485541848574 + id: 01HFD81Y01D65FJ7EPNNM58GPK + ticket_form_id: 7485506877054 + TicketFormUpdateResponseExample: + value: + ticket_form: + active: true + agent_conditions: [ ] + created_at: "2012-04-02T22:55:29Z" + default: true + deleted_at: "2012-05-02T22:55:29Z" + display_name: Snowboard has been fixed + end_user_conditions: [ ] + end_user_visible: true + id: 47 + in_all_brands: true + name: Snowboard Fixed + position: 9999 + raw_display_name: Snowboard has been fixed + raw_name: Snowboard Fixed + restricted_brand_ids: [ ] + ticket_field_ids: + - 2 + - 4 + - 5 + - 32 + - 44 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_forms/47 + TicketFormsResponseExample: + value: + ticket_forms: + - active: true + agent_conditions: + - child_fields: + - id: 44 + is_required: false + required_on_statuses: + statuses: + - new + - open + - pending + - hold + type: SOME_STATUSES + - id: 32 + is_required: true + required_on_statuses: + statuses: + - solved + type: SOME_STATUSES + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: true + required_on_statuses: + type: ALL_STATUSES + - id: 32 + is_required: false + required_on_statuses: + type: NO_STATUSES + parent_field_id: 32 + value: matching_value_2 + created_at: "2012-04-02T22:55:29Z" + default: true + deleted_at: "2012-05-02T22:55:29Z" + display_name: Snowboard Damage + end_user_conditions: + - child_fields: + - id: 32 + is_required: true + parent_field_id: 5 + value: matching_value_1 + - child_fields: + - id: 44 + is_required: false + parent_field_id: 32 + value: matching_value_2 + end_user_visible: true + id: 47 + in_all_brands: false + name: Snowboard Problem + position: 9999 + raw_display_name: '{{dc.my_display_name}}' + raw_name: Snowboard Problem + restricted_brand_ids: + - 1 + - 4 + - 6 + - 12 + - 34 + ticket_field_ids: + - 2 + - 4 + - 5 + - 32 + - 44 + updated_at: "2012-04-02T22:55:29Z" + url: https://company.zendesk.com/api/v2/ticket_forms/47 + TicketImportRequestExample: + value: + ticket: + assignee_id: 19 + comments: + - author_id: 827 + created_at: "2009-06-25T10:15:18Z" + value: This is a comment + - author_id: 19 + public: false + value: This is a private comment + description: A description + requester_id: 827 + subject: Help + tags: + - foo + - bar + TicketMergeInputExample: + value: + ids: + - 123 + - 456 + - 789 + source_comment: 'Closing in favor of #111' + target_comment: 'Combining with #123, #456, #789' + TicketMetricEventsResponseExample: + value: + count: 3 + end_time: 1603716792 + next_page: https://company.zendesk.com/api/v2/incremental/ticket_metric_events?start_time=1603716792 + ticket_metric_events: + - id: 926232157301 + instance_id: 0 + metric: agent_work_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: measure + - id: 926232757371 + instance_id: 1 + metric: agent_work_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: activate + - id: 926232927415 + instance_id: 0 + metric: pausable_update_time + ticket_id: 155 + time: "2020-10-26T12:53:12Z" + type: measure + TicketMetricResponseExample: + value: + ticket_metric: + - agent_wait_time_in_minutes: + business: 0 + calendar: 0 + assigned_at: "2020-07-20T06:21:26Z" + assignee_stations: 0 + assignee_updated_at: "2020-07-20T06:21:26Z" + created_at: "2020-07-21T01:01:42Z" + first_resolution_time_in_minutes: + business: 0 + calendar: 0 + full_resolution_time_in_minutes: + business: 0 + calendar: 0 + group_stations: 0 + id: 33 + initially_assigned_at: "2020-07-20T06:21:26Z" + latest_comment_added_at: "2020-07-21T01:17:16Z" + on_hold_time_in_minutes: + business: 0 + calendar: 0 + reopens: 0 + replies: 1 + reply_time_in_minutes: + business: 16 + calendar: 16 + reply_time_in_seconds: + calendar: 960 + requester_updated_at: "2020-07-21T01:17:16Z" + requester_wait_time_in_minutes: + business: 0 + calendar: 0 + solved_at: "2020-07-20T06:21:26Z" + status_updated_at: "2020-07-21T01:01:41Z" + ticket_id: 1517 + updated_at: "2020-07-21T01:17:16Z" + url: https://example.zendesk.com/api/v2/ticket_metrics/33 + TicketMetricsResponseExample: + value: + ticket_metrics: + - agent_wait_time_in_minutes: + business: 0 + calendar: 0 + assigned_at: "2020-07-20T06:21:26Z" + assignee_stations: 0 + assignee_updated_at: "2020-07-20T06:21:26Z" + created_at: "2020-07-21T01:01:42Z" + first_resolution_time_in_minutes: + business: 0 + calendar: 0 + full_resolution_time_in_minutes: + business: 0 + calendar: 0 + group_stations: 0 + id: 33 + initially_assigned_at: "2020-07-20T06:21:26Z" + latest_comment_added_at: "2020-07-21T01:17:16Z" + on_hold_time_in_minutes: + business: 0 + calendar: 0 + reopens: 0 + replies: 1 + reply_time_in_minutes: + business: 16 + calendar: 16 + reply_time_in_seconds: + calendar: 960 + requester_updated_at: "2020-07-21T01:17:16Z" + requester_wait_time_in_minutes: + business: 0 + calendar: 0 + solved_at: "2020-07-20T06:21:26Z" + status_updated_at: "2020-07-21T01:01:41Z" + ticket_id: 1517 + updated_at: "2020-07-21T01:17:16Z" + url: https://example.zendesk.com/api/v2/ticket_metrics/33 + - agent_wait_time_in_minutes: + business: 0 + calendar: 0 + assigned_at: "2020-07-20T06:21:26Z" + assignee_stations: 0 + assignee_updated_at: "2020-07-20T06:21:26Z" + created_at: "2020-07-20T06:21:27Z" + first_resolution_time_in_minutes: + business: 0 + calendar: 0 + full_resolution_time_in_minutes: + business: 0 + calendar: 0 + group_stations: 0 + id: 34 + initially_assigned_at: "2020-07-20T06:21:26Z" + latest_comment_added_at: "2020-07-20T06:21:26Z" + on_hold_time_in_minutes: + business: 0 + calendar: 0 + reopens: 0 + replies: 0 + reply_time_in_minutes: + business: 0 + calendar: 0 + reply_time_in_seconds: + calendar: 0 + requester_updated_at: "2020-07-20T06:21:26Z" + requester_wait_time_in_minutes: + business: 0 + calendar: 0 + solved_at: "2020-07-20T06:21:26Z" + status_updated_at: "2020-07-20T06:21:26Z" + ticket_id: 1511 + updated_at: "2020-07-20T06:21:27Z" + url: https://example.zendesk.com/api/v2/ticket_metrics/34 + TicketRelatedInformationExample: + value: + followup_source_ids: [ ] + from_archive: false + incidents: 7 + jira_issue_ids: [ ] + topic_id: null + TicketResponseExample: + value: + ticket: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + TicketSkipCreationExample: + value: + skip: + created_at: "2015-09-30T21:44:03Z" + id: 1 + reason: I have no idea. + ticket: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1443575048 + group_id: 98738 + has_incidents: false + id: 123 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + ticket_id: 123 + updated_at: "2015-09-30T21:44:03Z" + user_id: 456 + TicketSkipResponseExample: + value: + skips: + - created_at: "2015-09-30T21:44:03Z" + id: 1 + reason: I have no idea. + ticket: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 123 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + ticket_id: 123 + updated_at: "2015-09-30T21:44:03Z" + user_id: 456 + - created_at: "2015-10-01T21:44:03Z" + id: 2 + reason: I am lost. + ticket: + assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 321 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + ticket_id: 321 + updated_at: "2015-10-01T21:44:03Z" + user_id: 654 + TicketUpdateRequestExample: + value: + ticket: + comment: + body: Thanks for choosing Acme Jet Motors. + public: true + custom_status_id: 321 + status: solved + TicketUpdateResponseExample: + value: + audit: + events: + - field_name: subject + id: 206091192546 + type: Create + value: My printer is on fire! + - body: The smoke is very colorful. + id: 206091192547 + type: Comment + - field_name: status + id: 206091192548 + type: Create + value: open + - field_name: custom_status_id + id: 206091192549 + type: Create + value: 123 + ticket: + custom_status_id: 123 + id: 35436 + requester_id: 123453 + status: open + subject: My printer is on fire! + TicketsCreateRequestExample: + value: + tickets: + - comment: + body: The smoke is very colorful. + priority: urgent + subject: My printer is on fire! + - comment: + body: This is a comment + priority: normal + subject: Help + TicketsResponseExample: + value: + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + custom_status_id: 123 + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + TicketsUpdateRequestBatchUpdateExample: + summary: Batch update - different changes to different tickets + description: Updates each ticket with its own set of changes + value: + tickets: + - id: 1 + priority: low + status: solved + - assignee_id: 12345 + id: 2 + status: pending + TicketsUpdateRequestBulkUpdateTagsExample: + summary: Bulk update with tag management + description: Add or remove tags without overwriting existing ones + value: + ticket: + additional_tags: + - urgent + - escalated + remove_tags: + - pending_review + TicketsUpdateRequestDefaultExample: + summary: Bulk update - same change to multiple tickets + description: Updates all tickets specified in the ids query parameter with the same values + value: + ticket: + comment: + body: This issue has been resolved + status: solved + TimeBasedExportIncrementalTicketsResponseExample: + value: + count: 2 + end_of_stream: true + end_time: 1390362485 + next_page: https://{subdomain}.zendesk.com/api/v2/incremental/tickets?per_page=3&start_time=1390362485 + tickets: + - assignee_id: 235323 + collaborator_ids: + - 35334 + - 234 + created_at: "2009-07-20T22:55:29Z" + custom_fields: + - id: 27642 + value: "745" + - id: 27648 + value: "yes" + description: The fire is very colorful. + due_at: null + external_id: ahg35h3jh + follower_ids: + - 35334 + - 234 + from_messaging_channel: false + generated_timestamp: 1304553600 + group_id: 98738 + has_incidents: false + id: 35436 + organization_id: 509974 + priority: high + problem_id: 9873764 + raw_subject: '{{dc.printer_on_fire}}' + recipient: support@company.com + requester_id: 20978392 + satisfaction_rating: + comment: Great support! + id: 1234 + score: good + sharing_agreement_ids: + - 84432 + status: open + subject: Help, my printer is on fire! + submitter_id: 76872 + tags: + - enterprise + - other_tag + type: incident + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/tickets/35436 + via: + channel: web + TimeBasedExportIncrementalUsersResponseExample: + value: + count: 1 + end_of_stream: true + end_time: 1601357503 + next_page: https://example.zendesk.com/api/v2/incremental/ticket_events?start_time=1601357503 + users: + - active: true + alias: Mr. Johnny + created_at: "2009-07-20T22:55:29Z" + custom_role_id: 9373643 + details: "" + email: johnny@example.com + external_id: sai989sur98w9 + id: 35436 + last_login_at: "2011-05-05T10:38:52Z" + locale: en-US + locale_id: 1 + moderator: true + name: Johnny Agent + notes: Johnny is a nice guy! + only_private_comments: false + organization_id: 57542 + phone: "+15551234567" + photo: + content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic.png + id: 928374 + name: my_funny_profile_pic.png + size: 166144 + thumbnails: + - content_type: image/png + content_url: https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png + id: 928375 + name: my_funny_profile_pic_thumb.png + size: 58298 + restricted_agent: true + role: agent + role_type: 0 + shared: false + shared_agent: false + signature: Have a nice day, Johnny + suspended: true + tags: + - enterprise + - other_tag + ticket_restriction: assigned + time_zone: Copenhagen + updated_at: "2011-05-05T10:38:52Z" + url: https://company.zendesk.com/api/v2/users/35436 + user_fields: + user_date: "2012-07-23T00:00:00Z" + user_decimal: 5.1 + user_dropdown: option_1 + verified: true + TrialAccountResponseExample: + value: + account: + name: Sample Partner Account + subdomain: partner12345 + url: https://partner12345.zendesk.com + TriggerBulkUpdateRequestExample: + value: + triggers: + - id: 25 + position: 5 + - active: false + id: 26 + - category_id: "10027" + id: 27 + TriggerDefinitionResponseExample: + value: + definitions: + actions: + - group: ticket + nullable: false + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: Open + value: open + - enabled: true + title: Pending + value: pending + - enabled: true + title: Solved + value: solved + - enabled: true + title: Closed + value: closed + conditions_all: + - group: ticket + nullable: false + operators: + - terminal: false + title: Is + value: is + - terminal: false + title: Is not + value: is_not + - terminal: false + title: Less than + value: less_than + - terminal: false + title: Greater than + value: greater_than + - terminal: true + title: Changed + value: changed + - terminal: false + title: Changed to + value: value + - terminal: false + title: Changed from + value: value_previous + - terminal: true + title: Not changed + value: not_changed + - terminal: false + title: Not changed to + value: not_value + - terminal: false + title: Not changed from + value: not_value_previous + repeatable: false + subject: status + title: Status + type: list + values: + - enabled: true + title: New + value: new + - enabled: true + title: Open + value: open + - enabled: true + title: Pending + value: pending + - enabled: true + title: Solved + value: solved + - enabled: true + title: Closed + value: closed + conditions_any: + - group: ticket + nullable: true + operators: + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_fields_20513432 + title: Happy Gilmore + type: list + - group: ticket + nullable: true + operators: + - terminal: true + title: Present + value: present + - terminal: true + title: Not present + value: not_present + repeatable: false + subject: custom_fields_86492341 + title: total_time_field + type: list + TriggerResponseExample: + value: + trigger: + actions: [ ] + active: true + category_id: "10026" + conditions: { } + created_at: "2012-09-25T22:50:26Z" + description: Close and save a ticket + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/25 + TriggerRevisionResponseExample: + value: + trigger_revision: + author_id: 3343 + created_at: "2020-05-28T06:41:43Z" + id: 1 + snapshot: + actions: + - field: notification_target + value: + - "510312" + - '{}' + active: true + conditions: + all: [ ] + any: + - field: current_tags + operator: includes + value: fire_bulk_1 + description: null + title: bulk_test_trigger_1 + url: https://example.zendesk.com/api/v2/triggers/261303831/revisions/1 + TriggerRevisionsResponseExample: + value: + after_cursor: MTUwMTYwNzUyMi4wfHwxMzQ3NTMxNjcxfA== + after_url: https://{subdomain}.zendesk.com/api/v2/triggers/{trigger_id}/revisions?cursor=MTUwMTYwNzUyMi4wfHwxMzQ3NTMxNjcxfA%3D%3D&limit=20 + before_cursor: fDE1MDE1NzUxMjIuMHx8MTM0NzM0MzAxMQ== + before_url: https://{subdomain}.zendesk.com/api/v2/triggers/{trigger_id}/revisions?cursor=fDE1MDE1NzUxMjIuMHx8MTM0NzM0MzAxMQ%3D%3D&limit=20 + count: 1 + trigger_revisions: + - author_id: 2 + created_at: "2016-08-15T16:04:06Z" + diff: + actions: [ ] + active: [ ] + conditions: { } + description: [ ] + source_id: 1 + target_id: 2 + title: [ ] + id: 100 + snapshot: + actions: + - field: notification_target + value: + - "510312" + - '{}' + active: true + conditions: + all: [ ] + any: + - field: current_tags + operator: includes + value: fire_bulk_1 + description: Notifies requester that a comment was updated + title: Notify requester of comment update + url: https://{subdomain}.zendesk.com/api/v2/trigger/123/revisions/100 + TriggerWithCategoryRequestExample: + value: + trigger: + actions: + - field: group_id + value: "20455932" + category_id: "10026" + conditions: + all: + - field: status + operator: is + value: open + - field: priority + operator: less_than + value: high + title: Roger Wilco + TriggersActiveResponseExample: + value: + count: 2 + next_page: null + previous_page: null + triggers: + - actions: [ ] + active: true + conditions: { } + created_at: "2012-09-25T22:50:26Z" + description: Close and save a ticket + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/25 + - actions: [ ] + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: status + operator: less_than + value: solved + created_at: "2012-09-25T22:50:26Z" + description: Assign a ticket with a priority tag + id: 26 + position: 9 + raw_title: '{{dc.assign_priority_tag}}' + title: Assign priority tag + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/26 + TriggersResponseExample: + value: + count: 2 + next_page: null + previous_page: null + triggers: + - actions: [ ] + active: true + conditions: { } + created_at: "2012-09-25T22:50:26Z" + description: Close and save a ticket + id: 25 + position: 8 + raw_title: Close and Save + title: Close and Save + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/25 + - actions: [ ] + active: false + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: status + operator: less_than + value: solved + - field: custom_status_id + operator: includes + value: + - "1" + - "2" + created_at: "2012-09-25T22:50:26Z" + description: Assign a ticket with a priority tag + id: 26 + position: 9 + raw_title: '{{dc.assign_priority_tag}}' + title: Assign priority tag + updated_at: "2012-09-25T22:50:26Z" + url: http://{subdomain}.zendesk.com/api/v2/triggers/26 + TriggersSearchResponseExample: + value: + count: 2 + next_page: null + previous_page: null + triggers: + - actions: [ ] + active: true + conditions: + all: + - field: status + operator: less_than + value: solved + - field: assignee_id + operator: is + value: "296220096" + any: + - field: status + operator: less_than + value: solved + created_at: "2012-09-25T22:50:26Z" + description: Close and save a ticket + id: 25 + position: 9 + raw_title: Close and Save + title: Close and Save + updated_at: "2012-09-25T22:50:26Z" + - actions: [ ] + active: true + conditions: { } + created_at: "2012-09-25T22:50:26Z" + id: 28 + position: 9 + raw_title: '{{dc.close_and_redirect}}' + title: Close and redirect to topics + updated_at: "2012-09-25T22:50:26Z" + TwitterChannelResponseExample: + value: + monitored_twitter_handle: + created_at: "2010-05-13T22:07:08Z" + id: 431 + screen_name: '@zendeskops' + twitter_user_id: 67923318930 + updated_at: "2011-07-22T00:15:19Z" + TwitterChannelTwicketStatusResponseExample: + value: + statuses: + - favorited: true + id: 834 + retweeted: false + user_followed: true + TwitterChannelsResponseExample: + value: + monitored_twitter_handles: + - created_at: "2009-05-13T00:07:08Z" + id: 211 + screen_name: '@zendesk' + twitter_user_id: 67462376832 + updated_at: "2011-07-22T00:11:12Z" + - created_at: "2010-05-13T22:07:08Z" + id: 431 + screen_name: '@zendeskops' + twitter_user_id: 67923318930 + updated_at: "2011-07-22T00:15:19Z" + UpdateDeletionScheduleRequestExample: + value: + deletion_schedule: + active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + description: Delete tickets older than 1 year + title: some schedule + UpdateDeletionScheduleResponseExample: + value: + deletion_schedule: + active: true + conditions: + all: + - field: duration_since_last_update + operator: greater_than + value: P1Y + any: [ ] + default: false + description: Delete tickets older than 1 year + id: 7772196094461 + title: some schedule + url: https://{some domain}.zendesk.com/api/v2/deletion_schedules/7772196094461 + UpdateMacroResponseExample: + value: + macro: + actions: + - field: status + value: solved + active: true + description: Sets the ticket status to `solved` + id: 25 + position: 42 + restriction: { } + title: Close and Save + UpdateManyUsersRequestExample: + value: + user: + organization_id: 1 + UpdateOrganizationResponseExample: + value: + organization: + created_at: "2018-11-14T00:14:52Z" + details: caterpillar =) + domain_names: + - remain.com + external_id: null + group_id: 1835962 + id: 4112492 + name: Groablet Enterprises + notes: Something Interesting + organization_fields: + datepudding: "2018-11-04T00:00:00+00:00" + org_field_1: happy happy + org_field_2: teapot_kettle + shared_comments: false + shared_tickets: false + tags: + - smiley + - teapot_kettle + updated_at: "2018-11-14T00:54:22Z" + url: https://example.zendesk.com/api/v2/organizations/4112492 + UpdateUserRequestExample: + value: + user: + name: Roger Wilco II + UpdateUserResponseExample: + value: + user: + id: 9873843 + name: Roger Wilco II + UserCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 102 + UserCreateResponseExample: + value: + user: + custom_role_id: 123456 + email: roge@example.org + id: 9873843 + name: Roger Wilco + organization_id: 57542 + role: agent + role_type: 0 + UserEntitlementsFullResponseExample: + value: + entitlements: + chat: + is_active: true + name: admin + explore: + is_active: true + name: admin + guide: + is_active: true + name: admin + talk: + is_active: true + name: lead + UserFieldCreateResponseExample: + value: + user_field: + active: true + created_at: "2013-02-27T20:35:55Z" + description: This field describes the support plan this user has + id: 75 + key: support_description + position: 0 + raw_description: This field describes the support plan this user has + raw_title: Support description + regexp_for_validation: null + title: Support description + type: text + updated_at: "2013-02-27T20:35:55Z" + url: https://company.zendesk.com/api/v2/user_fields/75 + UserFieldResponseExample: + value: + user_field: + active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/user_fields/7 + UserFieldUpdateResponseExample: + value: + user_field: + active: true + created_at: "2013-02-27T20:35:55Z" + description: This field describes the support plan this user has + id: 75 + key: support_description + position: 0 + raw_description: This field describes the support plan this user has + raw_title: Support description + regexp_for_validation: null + title: Support description + type: text + updated_at: "2013-02-27T20:35:55Z" + url: https://company.zendesk.com/api/v2/user_fields/75 + UserFieldsResponseExample: + value: + count: 1 + next_page: null + previous_page: null + user_fields: + - active: true + created_at: "2012-10-16T16:04:06Z" + description: Description of Custom Field + id: 7 + key: custom_field_1 + position: 9999 + raw_description: '{{dc.my_description}}' + raw_title: Custom Field 1 + regexp_for_validation: null + title: Custom Field 1 + type: text + updated_at: "2012-10-16T16:04:06Z" + url: https://company.zendesk.com/api/v2/user_fields/7 + UserIdentitiesResponseExample: + value: + identities: + - created_at: "2011-07-20T22:55:29Z" + id: 35436 + primary: true + type: email + updated_at: "2011-07-20T22:55:29Z" + user_id: 135 + value: someone@example.com + verification_method: low + verified: true + - created_at: "2012-02-12T14:25:21Z" + id: 77136 + primary: false + type: twitter + updated_at: "2012-02-12T14:25:21Z" + user_id: 135 + value: didgeridooboy + verification_method: low + verified: true + - created_at: "2012-02-12T14:25:21Z" + id: 88136 + primary: true + type: phone_number + updated_at: "2012-02-12T14:25:21Z" + user_id: 135 + value: +1 555-123-4567 + verification_method: low + verified: true + UserIdentityCreateResponseExample: + value: + identity: + created_at: "2012-02-12T14:25:21Z" + id: 77938 + primary: false + type: twitter + updated_at: "2012-02-12T14:25:21Z" + user_id: 13531 + value: cabanaboy + verification_method: none + verified: false + UserIdentityResponseExample: + value: + identity: + created_at: "2012-02-12T14:25:21Z" + id: 77938 + primary: false + type: twitter + updated_at: "2012-02-12T14:25:21Z" + user_id: 13531 + value: cabanaboy + verified: false + UserIdentityUpdateResponseExample: + value: + identity: + created_at: "2011-07-20T22:55:29Z" + deliverable_state: deliverable + id: 35436 + primary: true + type: email + updated_at: "2011-07-20T22:55:29Z" + user_id: 135 + value: someone@example.com + verification_method: low + verified: true + UserPasswordRequirementsResponseExample: + value: + requirements: + - must be at least 5 characters + - must be different from email address + UserRelatedResponseExample: + value: + user_related: + assigned_tickets: 5 + ccd_tickets: 3 + organization_subscriptions: 1 + requested_tickets: 10 + UserRequestExample: + value: + user: + agent_brand_ids: + - 8119246973690 + - 8119246973691 + - 8119246973692 + custom_role_id: 123456 + email: roge@example.org + identities: + - type: email + value: test@user.com + - type: twitter + value: tester84 + name: Roger Wilco + organization: + name: VIP Customers + role: agent + UserResponseExample: + value: + user: + id: 35436 + name: Johnny Agent + UserSettingsResponseExample: + value: + settings: + admin_center: + has_admin_center_side_nav_open: true + has_seen_admin_center_dark_mode_banner: false + lotus: + agent_workspace_theme_preference: "0" + agent_workspace_theme_preference_for_conversation_panel: "0" + keyboard_shortcuts_enabled: false + macro_shortcuts_enabled: false + show_onboarding_tooltips: true + show_reporting_video_tutorial: true + show_welcome_dialog: true + two_factor_authentication: false + UsersCreateManyRequestExample: + value: + users: + - agent_brand_ids: + - 8119246973690 + - 8119246973691 + - 8119246973692 + email: roge@example.org + name: Roger Wilco + organization_id: 567812345 + role: agent + - email: woge@example.org + name: Woger Rilco + role: admin + UsersRequestExample: + value: + users: + - agent_brand_ids: + - 8119246973690 + - 8119246973691 + - 8119246973692 + custom_role_id: 123456 + email: roge@example.org + identities: + - type: email + value: test@user.com + - type: twitter + value: tester84 + name: Roger Wilco + organization: + name: VIP Customers + role: agent + - email: woge@example.org + external_id: account_54321 + name: Woger Rilco + role: admin + UsersResponseExample: + value: + users: + - id: 223443 + name: Johnny Agent + - id: 8678530 + name: James A. Rosen + ViewCategoriesBadRequestResponseExample.yaml: + value: + errors: + - code: InvalidViewCategory + title: Name cannot be blank + ViewCategoriesForbiddenResponseExample: + value: + errors: + - code: ViewCategoriesNotEnabled + title: View categories are not enabled for your account. + ViewCategoriesResponseExample: + value: + view_categories: + - created_at: "2024-09-12T07:04:15Z" + id: "10001" + name: Your unsolved tickets Updated + parent_id: null + position: 1 + updated_at: "2024-09-12T07:04:15Z" + url: https://{subdomain}.zendesk.com/api/v2/view_categories/10001 + - created_at: "2024-09-12T07:05:21Z" + id: "10002" + name: All unsolved tickets + parent_id: null + position: 2 + updated_at: "2024-09-12T07:05:21Z" + url: https://{subdomain}.zendesk.com/api/v2/view_categories/10002 + ViewCountResponseExample: + value: + view_count: + fresh: true + pretty: ~700 + url: https://company.zendesk.com/api/v2/views/25/count + value: 719 + view_id: 25 + ViewCountsResponseExample: + value: + view_counts: + - fresh: true + pretty: ~700 + url: https://company.zendesk.com/api/v2/views/25/count + value: 719 + view_id: 25 + - fresh: false + pretty: '...' + url: https://company.zendesk.com/api/v2/views/78/count + value: null + view_id: 78 + ViewCreateResponseExample: + value: + view: + active: true + conditions: + all: + - field: status + operator: is + value: open + - field: priority + operator: less_than + value: high + any: + - field: current_tags + operator: includes + value: hello + id: 9873843 + title: Roger Wilco + ViewExecuteResponseExample: + value: + columns: + - id: locale + title: Locale + - id: 5 + title: Account + groups: [ ] + rows: + - group: 1 + locale: en-US + ticket: { } + view: + id: 25 + ViewExportResponseExample: + value: + export: + status: starting + view_id: 25 + ViewListTicketsResponseEXample: + value: + tickets: + - id: 35436 + requester_id: 20978392 + subject: Help I need somebody! + - id: 20057623 + requester_id: 20978392 + subject: Not just anybody! + ViewPreviewResponseExample: + value: + columns: + - id: subject + title: Subject + rows: + - subject: en-US + ticket: { } + ViewResponseExample: + value: + view: + active: true + conditions: { } + description: View for recent tickets + execution: { } + id: 25 + position: 3 + restriction: { } + title: Tickets updated less than 12 Hours + ViewUpdateResponseExample: + value: + view: + active: true + conditions: { } + description: View for recent tickets + execution: { } + id: 25 + position: 3 + restriction: { } + title: Roger Wilco II + ViewsActiveResponseExample: + value: + count: 2 + next_page: null + previous_page: null + views: + - active: true + conditions: { } + description: View for recent tickets + execution: { } + id: 25 + position: 3 + restriction: { } + title: Tickets updated less than 12 Hours + - active: true + conditions: { } + description: View for tickets that are not assigned + execution: { } + id: 23 + position: 7 + restriction: { } + title: Unassigned tickets + ViewsCountResponseExample: + value: + count: + refreshed_at: "2020-04-06T02:18:17Z" + value: 16 + ViewsResponseExample: + value: + count: 2 + next_page: null + previous_page: null + views: + - active: true + conditions: { } + description: View for recent tickets + execution: { } + id: 25 + position: 3 + restriction: { } + title: Tickets updated less than 12 Hours + - active: false + conditions: { } + description: View for tickets that are not assigned + execution: { } + id: 23 + position: 7 + restriction: { } + title: Unassigned tickets + ViewsUpdateManyResponseExample: + value: + views: + - active: true + conditions: { } + description: View for recent tickets + execution: { } + id: 123 + position: 8 + restriction: { } + title: Tickets updated less than 12 Hours + securitySchemes: + basicAuth: + type: http + scheme: basic +security: + - basicAuth: [ ] + diff --git a/src/main/resources/params.txt b/src/main/resources/params.txt new file mode 100644 index 0000000..10f4d55 --- /dev/null +++ b/src/main/resources/params.txt @@ -0,0 +1,120 @@ + +> CursorPaginationSort: + name: sort + in: query + description: | + Field to sort results by. Prefix with `-` for descending order. + + When used with cursor pagination, this determines the cursor ordering. + + Example: `?sort=name` or `?sort=-created_at` + schema: + type: string + example: name + CustomObjectFieldKeyOrId: + name: custom_object_field_key_or_id + in: path + description: The key or id of a custom object field + required: true + schema: + type: string + example: make + CustomObjectKey: +> DualPaginationPage: + name: page + in: query + description: | + Pagination parameter. Supports both traditional offset and cursor-based pagination: + + - Traditional: `?page=2` (integer page number) + - Cursor: `?page[size]=50&page[after]=cursor` (deepObject with size, after, before) + + These are mutually exclusive - use one format or the other, not both. + style: deepObject + explode: true + schema: + oneOf: + - type: integer + description: Traditional offset pagination page number (non-negative integer) + example: 1 + - type: object + description: Cursor pagination parameters (JSON:API style) + properties: + after: +> PerPage: + name: per_page + in: query + description: | + Number of records to return per page. + + Note: Default and maximum values vary by endpoint. Check endpoint-specific + documentation for limits. + schema: + type: integer + minimum: 1 + example: 50 + RequestId: + name: request_id + in: path + description: The ID of the request + required: true + schema: + type: integer + example: 33 + ResourceCollectionId: +> TicketSortBy: + name: sort_by + in: query + description: Sort by + schema: + type: string + enum: + - id + - subject + - deleted_at + - created_at + - updated_at + - status + - requester + - requester.name + - group + - assignee + - assignee.name +> TicketSortOrder: + name: sort_order + in: query + description: Sort order. Defaults to "asc" + schema: + type: string + enum: + - asc + - desc +> TicketSupportTypeScope: + name: support_type_scope + in: query + description: | + Lists tickets by support type. Possible values are "all", "agent", or "ai_agent". Defaults to "agent" + schema: + type: string +> TicketsInclude: + name: include + in: query + description: | + Sideloads to include in the response. Accepts a comma-separated list of values. + See [Sideloading](/api-reference/ticketing/tickets/tickets/#sideloading). + schema: + type: string + example: users,groups,organizations + TriggerActive: + name: active + in: query + description: Filter by active triggers if true or inactive triggers if false + schema: + type: boolean + example: true + TriggerCategoryId: + name: category_id + in: query + description: Filter triggers by category ID + schema: + diff --git a/src/main/resources/z4j.yaml b/src/main/resources/z4j.yaml index 7de98a7..5bf1fcb 100644 --- a/src/main/resources/z4j.yaml +++ b/src/main/resources/z4j.yaml @@ -1,970 +1,956 @@ +# Copyright 2026 Peanut Butter Unicorn LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. openapi: 3.0.2 info: title: Help Center API description: Help Center v2 REST API version: 2.0.0 -paths: - /api/v2/ticket_fields: - get: - operationId: ListTicketFields - tags: - - Ticket - summary: List Ticket Fields - description: | -

Returns a list of all system and custom ticket fields in your account.

-

For end users, only the ticket fields with visible_in_portal set to true are returned.

-

Consider caching this resource to use with the{@link TicketClient}.

-