> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/code-repository/user.md).

# User

## POST /user/favorite

> Create favorite

```json
{"openapi":"3.0.0","info":{"title":"API Specification","version":"1.111.0"},"servers":[{"url":"gateway/code/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"TypesFavoriteResource":{"properties":{"resource_id":{"type":"integer"},"resource_type":{"$ref":"#/components/schemas/EnumResourceType"}},"type":"object"},"EnumResourceType":{"enum":["CONNECTOR","GITSPACE","INFRAPROVIDER","INTEGRATION","PIPELINE","REGISTRY","REPOSITORY","SECRET","SERVICE","SERVICEACCOUNT","SPACE","TEMPLATE","USER"],"type":"string"},"UsererrorError":{"properties":{"message":{"type":"string"},"values":{"additionalProperties":{},"type":"object"}},"type":"object"}}},"paths":{"/user/favorite":{"post":{"operationId":"createFavorite","parameters":[{"description":"Account Identifier for the Entity.","in":"query","name":"accountIdentifier","required":true,"schema":{"type":"string"}},{"description":"Organization Identifier for the Entity.","in":"query","name":"orgIdentifier","required":false,"schema":{"type":"string"}},{"description":"Project Identifier for the Entity.","in":"query","name":"projectIdentifier","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesFavoriteResource"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesFavoriteResource"}}},"description":"Created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Internal Server Error"}},"summary":"Create favorite","tags":["user"]}}}}
```

## DELETE /user/favorite/{resource\_id}

> Delete favorite

```json
{"openapi":"3.0.0","info":{"title":"API Specification","version":"1.111.0"},"servers":[{"url":"gateway/code/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"UsererrorError":{"properties":{"message":{"type":"string"},"values":{"additionalProperties":{},"type":"object"}},"type":"object"}}},"paths":{"/user/favorite/{resource_id}":{"delete":{"operationId":"deleteFavorite","parameters":[{"description":"Account Identifier for the Entity.","in":"query","name":"accountIdentifier","required":true,"schema":{"type":"string"}},{"description":"Organization Identifier for the Entity.","in":"query","name":"orgIdentifier","required":false,"schema":{"type":"string"}},{"description":"Project Identifier for the Entity.","in":"query","name":"projectIdentifier","required":false,"schema":{"type":"string"}},{"description":"The type of the resource to be unfavorited.","in":"query","name":"resource_type","required":false,"schema":{"enum":["CONNECTOR","GITSPACE","INFRAPROVIDER","INTEGRATION","PIPELINE","REGISTRY","REPOSITORY","SECRET","SERVICE","SERVICEACCOUNT","SPACE","TEMPLATE","USER"],"type":"string"}},{"in":"path","name":"resource_id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Internal Server Error"}},"summary":"Delete favorite","tags":["user"]}}}}
```
