---
title: "Create a favorite"
method: POST
path: "/me/favorites"
tags: ["favorites"]
---

# Create a favorite

`POST /me/favorites`

## Request

- Base URL: `https://localhost:8080/api/v9`
- URL: `https://localhost:8080/api/v9/me/favorites`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/toggl/apis/toggl-api/docs/me/favorites/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint allows the creation of a favorite given some parameters. The workspace is required, as well
as either description or project (no favorite without both will be accepted). The user is also required,
but it already goes in the authentication.
Also, the user must have access to all resources being referenced in the favorite attributes, and these
resources should have valid relationships. For instance, if you want a favorite in a given workspace and
with some tags, the tags must belong to that workspace. In case of user having no access to an attribute,
a 403 status is returned, if the attributes don't relate correctly between themselves the status
returned will be 400.

## Query parameters

- `meta` boolean

## Request body

- HandlerfavoritesPayload
  - `billable` boolean
  - `description` string
  - `project_id` integer
  - `tag_ids` integer[]
  - `task_id` integer
  - `workspace_id` integer

## Response `200`

Created favorite with its ID

- ModelsFavorite
  - `billable` boolean
  - `client_name` string: Related entities meta fields - if requested
  - `created_at` string
  - `deleted_at` string
  - `description` string
  - `favorite_id` integer
  - `project_active` boolean
  - `project_color` string
  - `project_id` integer
  - `project_name` string
  - `public` boolean
  - `rank` integer
  - `tag_ids` integer[]: tag IDs are loaded into this after loading the Favorite
  - `task_id` integer
  - `task_name` string
  - `workspace_id` integer

## Other responses

- `400`: Possible error messages:<ul><li>the parameter '{parameter}' is invalid</li><li>we could not parse the provided parameters</li><li>user %d has no access to Favorites feature</li><li>favorite attributes are not valid: {attributes}</li><li>favorite constraints were not met: {constraints}</li></ul>
- `403`: Possible error messages:<ul><li>user {user_id} has no access to Favorites feature</li><li>user {user_id} has no access to all resources: {resources}</li></ul>
- `500`: Internal Server Error

---

[API](https://skmtc.dev/toggl/apis/toggl-api.md) - [All operations](https://skmtc.dev/toggl/apis/toggl-api/llms.txt) - [OpenAPI document](https://skmtc.dev/toggl/apis/toggl-api/revisions/3085aee16990?raw)
