# ApiPolicies

## GET /api/v1/api-policies

> List API policies

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ApiPolicyListItemViewModelIEnumerableResponse":{"required":["Data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyListItemViewModel"},"description":"Response data","nullable":true}},"additionalProperties":false},"ApiPolicyListItemViewModel":{"type":"object","properties":{"id":{"type":"integer","description":"The unique identifier of the API policy","format":"int64","readOnly":true},"name":{"type":"string","description":"The name of the policy"},"description":{"type":"string","description":"The description of the policy","nullable":true}},"additionalProperties":false}}},"paths":{"/api/v1/api-policies":{"get":{"tags":["ApiPolicies"],"summary":"List API policies","parameters":[{"name":"Filter","in":"query","description":"Filter is matched against name, description and endpoints associated with the policy.","schema":{"type":"string","description":"Filter is matched against name, description and endpoints associated with the policy."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiPolicyListItemViewModelIEnumerableResponse"}}}}}}}}}
```

## POST /api/v1/api-policies

> Create an API policy

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ApiPolicySaveModel":{"required":["name","targetEndpoints"],"type":"object","properties":{"name":{"type":"string","description":"The name of the policy"},"description":{"type":"string","description":"The description of the policy","nullable":true},"tags":{"type":"array","items":{"type":"string"},"description":"The tags of the policy","nullable":true},"allowPublicAccess":{"type":"boolean","description":"Determines if public access is allowed"},"apiKeyName":{"type":"string","description":"The name of the API key"},"apiKeyLocation":{"$ref":"#/components/schemas/ParameterLocation"},"targetEndpoints":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyTargetEndpointSaveModel"},"description":"The list of target endpoints associated with the policy"},"identities":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentitySaveModel"},"description":"The list of identities associated with the policy","nullable":true},"apiKeyGroups":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupSaveModel"},"description":"The list of API key groups associated with the policy","nullable":true},"publicAccessDeployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the public access identity","nullable":true},"requestLoggingOptions":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyRequestLoggingSaveModel"},"description":"The list of request logging options associated with the api policy","nullable":true}},"additionalProperties":false},"ParameterLocation":{"enum":["Query","Header","Path","Cookie"],"type":"string"},"ApiPolicyTargetEndpointSaveModel":{"required":["path"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"path":{"type":"string","description":"The path of the target endpoint"},"method":{"$ref":"#/components/schemas/PolicyEndpointMethod"}},"additionalProperties":false},"PolicyEndpointMethod":{"enum":["All","Get","Post","Put","Head","Delete","Patch","Options","Connect","Trace"],"type":"string"},"ApiPolicyIdentitySaveModel":{"required":["deployments","issuers","name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"isPrivateApplication":{"type":"boolean","description":"Determines if it is a private application"},"issuers":{"type":"array","items":{"type":"string"},"description":"The issuers of the identity"},"name":{"type":"string","description":"The name of the identity"},"throttlingByClaim":{"type":"string","description":"The throttling by claim for the identity","nullable":true},"priorityNumber":{"type":"integer","description":"In case of 2 or more matching identities, determines which identity to use. Lower number will be selected.","format":"int32"},"id":{"type":"integer","description":"The unique identifier of the identity. Only provide a value when updating.","format":"int64","nullable":true},"identityRules":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentityRuleSaveModel"},"description":"The list of identity rules","nullable":true},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the identity"}},"additionalProperties":false},"ApiPolicyIdentityRuleSaveModel":{"required":["claim"],"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/ApiAccessRuleType"},"claim":{"type":"string","description":"The claim associated with the identity rule"},"value":{"type":"string","description":"The value associated with the identity rule","nullable":true},"matchType":{"$ref":"#/components/schemas/IdentityRuleMatchType"}},"additionalProperties":false},"ApiAccessRuleType":{"enum":["Allow","Deny"],"type":"string"},"IdentityRuleMatchType":{"enum":["Exact","Exists","Regex"],"type":"string"},"ApiPolicyDeploymentSaveModel":{"required":["agentGroupName"],"type":"object","properties":{"agentGroupName":{"type":"string","description":"The Agent Group associated with the deployment"}},"additionalProperties":false},"ApiPolicyApiKeyGroupSaveModel":{"required":["apiPolicyApiKeyGroupAssignments","name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"name":{"type":"string","description":"The name of the API key group"},"apiPolicyApiKeyGroupAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupAssignmentSaveModel"},"description":"The API key group assignments"}},"additionalProperties":false},"ApiPolicyApiKeyGroupAssignmentSaveModel":{"required":["apiKey"],"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiPolicyApiKeySaveModel"}},"additionalProperties":false},"ApiPolicyApiKeySaveModel":{"type":"object","properties":{"id":{"type":"integer","description":"The API key identifier","format":"int64"}},"additionalProperties":false},"ApiPolicyRequestLoggingSaveModel":{"required":["deployments","loggingFields","name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the request logging"},"loggingFields":{"type":"array","items":{"type":"string"},"description":"The fields logged by request logging"},"ipLogging":{"$ref":"#/components/schemas/IpLoggingType"},"requestBodyMaxLengthKb":{"type":"integer","description":"Request body maximum length for request logging","format":"int32"},"responseBodyMaxLengthKb":{"type":"integer","description":"Response body maximum length for request logging","format":"int32"},"disableLogging":{"type":"boolean","description":"Disable logging for request logging"},"id":{"type":"integer","description":"The unique identifier of the request logging. Only provide a value when updating.","format":"int64","nullable":true},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the request logging"}},"additionalProperties":false},"IpLoggingType":{"enum":["ClientIP","ClientIPXForwardedForFirst","ClientIPXForwardedForAll","Disable"],"type":"string"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/api-policies":{"post":{"tags":["ApiPolicies"],"summary":"Create an API policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiPolicySaveModel"}}}},"responses":{"201":{"description":"API policy created","headers":{"Location":{"description":"Location of the created API policy","schema":{"type":"string"}}}},"400":{"description":"API policy is invalid (check for duplicate endpoints)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"API policy contains endpoint that is already registered in existing policy","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## GET /api/v1/api-policies/{id}

> Get a single API policy

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ApiPolicyViewModelResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiPolicyViewModel"}},"additionalProperties":false},"ApiPolicyViewModel":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the policy"},"description":{"type":"string","description":"The description of the policy","nullable":true},"tags":{"type":"array","items":{"type":"string"},"description":"The tags of the policy","nullable":true},"allowPublicAccess":{"type":"boolean","description":"Determines if public access is allowed"},"apiKeyName":{"type":"string","description":"The name of the API key"},"apiKeyLocation":{"$ref":"#/components/schemas/ParameterLocation"},"id":{"type":"integer","description":"The identifier of the policy","format":"int64","readOnly":true},"uniqueIdentifier":{"type":"string","description":"The globally unique identifier of the policy","format":"uuid","readOnly":true},"modifier":{"type":"string","description":"The modifier of the policy","readOnly":true},"modifiedUtc":{"type":"string","description":"The timestamp when the policy was last modified","format":"date-time","readOnly":true},"targetEndpoints":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyTargetEndpointViewModel"},"description":"The list of target endpoints associated with the policy","readOnly":true},"identities":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentityViewModel"},"description":"The list of identities associated with the policy","readOnly":true},"apiKeyGroups":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupViewModel"},"description":"The list of API key groups associated with the policy","readOnly":true},"publicAccessDeployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentViewModel"},"description":"The list of deployments connected with public access identity","readOnly":true},"requestLoggingOptions":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyRequestLoggingViewModel"},"description":"The list of request logging options associated with the api policy","readOnly":true}},"additionalProperties":false},"ParameterLocation":{"enum":["Query","Header","Path","Cookie"],"type":"string"},"ApiPolicyTargetEndpointViewModel":{"required":["path"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"path":{"type":"string","description":"The path of the target endpoint"},"method":{"$ref":"#/components/schemas/PolicyEndpointMethod"},"id":{"type":"integer","description":"The unique identifier of the target endpoint","format":"int64","readOnly":true}},"additionalProperties":false},"PolicyEndpointMethod":{"enum":["All","Get","Post","Put","Head","Delete","Patch","Options","Connect","Trace"],"type":"string"},"ApiPolicyIdentityViewModel":{"required":["issuers","name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"isPrivateApplication":{"type":"boolean","description":"Determines if it is a private application"},"issuers":{"type":"array","items":{"type":"string"},"description":"The issuers of the identity"},"name":{"type":"string","description":"The name of the identity"},"throttlingByClaim":{"type":"string","description":"The throttling by claim for the identity","nullable":true},"priorityNumber":{"type":"integer","description":"In case of 2 or more matching identities, determines which identity to use. Lower number will be selected.","format":"int32"},"id":{"type":"integer","description":"The unique identifier of the identity","format":"int64","readOnly":true},"identityRules":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentityRuleViewModel"}},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentViewModel"},"description":"The list of deployments associated with the identity"}},"additionalProperties":false},"ApiPolicyIdentityRuleViewModel":{"type":"object","properties":{"id":{"type":"integer","description":"The unique identifier of the identity rule","format":"int64","readOnly":true},"ruleType":{"$ref":"#/components/schemas/ApiAccessRuleType"},"claim":{"type":"string","description":"The claim associated with the identity rule","readOnly":true},"value":{"type":"string","description":"The value associated with the identity rule","readOnly":true},"matchType":{"$ref":"#/components/schemas/IdentityRuleMatchType"}},"additionalProperties":false},"ApiAccessRuleType":{"enum":["Allow","Deny"],"type":"string"},"IdentityRuleMatchType":{"enum":["Exact","Exists","Regex"],"type":"string"},"ApiPolicyDeploymentViewModel":{"required":["agentGroupName"],"type":"object","properties":{"agentGroupName":{"type":"string","description":"The Agent Group associated with the deployment"},"id":{"type":"integer","description":"The unique identifier of the deployment","format":"int64","readOnly":true},"deployerUserName":{"type":"string","description":"The username of the deployer"},"deployedUtc":{"type":"string","description":"The timestamp when the deployment occurred","format":"date-time"}},"additionalProperties":false},"ApiPolicyApiKeyGroupViewModel":{"required":["name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"name":{"type":"string","description":"The name of the API key group"},"id":{"type":"integer","description":"The unique identifier of the API key group","format":"int64","readOnly":true},"apiPolicyApiKeyGroupAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupAssignmentViewModel"},"description":"The API group assignments","readOnly":true}},"additionalProperties":false},"ApiPolicyApiKeyGroupAssignmentViewModel":{"required":["apiKey"],"type":"object","properties":{"id":{"type":"integer","description":"The identifier of the assignment","format":"int64"},"apiKey":{"$ref":"#/components/schemas/ApiKeyViewModel"}},"additionalProperties":false},"ApiKeyViewModel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"value":{"type":"string","format":"uuid"}},"additionalProperties":false},"ApiPolicyRequestLoggingViewModel":{"required":["loggingFields","name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the request logging"},"loggingFields":{"type":"array","items":{"type":"string"},"description":"The fields logged by request logging"},"ipLogging":{"$ref":"#/components/schemas/IpLoggingType"},"requestBodyMaxLengthKb":{"type":"integer","description":"Request body maximum length for request logging","format":"int32"},"responseBodyMaxLengthKb":{"type":"integer","description":"Response body maximum length for request logging","format":"int32"},"disableLogging":{"type":"boolean","description":"Disable logging for request logging"},"id":{"type":"integer","description":"The unique identifier of the request logging","format":"int64","readOnly":true},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentViewModel"},"description":"The list of deployments associated with the request logging"}},"additionalProperties":false},"IpLoggingType":{"enum":["ClientIP","ClientIPXForwardedForFirst","ClientIPXForwardedForAll","Disable"],"type":"string"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/api-policies/{id}":{"get":{"tags":["ApiPolicies"],"summary":"Get a single API policy","operationId":"GetApiPolicy","parameters":[{"name":"id","in":"path","description":"API policy identifier","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiPolicyViewModelResponse"}}}},"404":{"description":"API policy not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## PUT /api/v1/api-policies/{id}

> Update an API policy

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ApiPolicySaveModel":{"required":["name","targetEndpoints"],"type":"object","properties":{"name":{"type":"string","description":"The name of the policy"},"description":{"type":"string","description":"The description of the policy","nullable":true},"tags":{"type":"array","items":{"type":"string"},"description":"The tags of the policy","nullable":true},"allowPublicAccess":{"type":"boolean","description":"Determines if public access is allowed"},"apiKeyName":{"type":"string","description":"The name of the API key"},"apiKeyLocation":{"$ref":"#/components/schemas/ParameterLocation"},"targetEndpoints":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyTargetEndpointSaveModel"},"description":"The list of target endpoints associated with the policy"},"identities":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentitySaveModel"},"description":"The list of identities associated with the policy","nullable":true},"apiKeyGroups":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupSaveModel"},"description":"The list of API key groups associated with the policy","nullable":true},"publicAccessDeployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the public access identity","nullable":true},"requestLoggingOptions":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyRequestLoggingSaveModel"},"description":"The list of request logging options associated with the api policy","nullable":true}},"additionalProperties":false},"ParameterLocation":{"enum":["Query","Header","Path","Cookie"],"type":"string"},"ApiPolicyTargetEndpointSaveModel":{"required":["path"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"path":{"type":"string","description":"The path of the target endpoint"},"method":{"$ref":"#/components/schemas/PolicyEndpointMethod"}},"additionalProperties":false},"PolicyEndpointMethod":{"enum":["All","Get","Post","Put","Head","Delete","Patch","Options","Connect","Trace"],"type":"string"},"ApiPolicyIdentitySaveModel":{"required":["deployments","issuers","name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"isPrivateApplication":{"type":"boolean","description":"Determines if it is a private application"},"issuers":{"type":"array","items":{"type":"string"},"description":"The issuers of the identity"},"name":{"type":"string","description":"The name of the identity"},"throttlingByClaim":{"type":"string","description":"The throttling by claim for the identity","nullable":true},"priorityNumber":{"type":"integer","description":"In case of 2 or more matching identities, determines which identity to use. Lower number will be selected.","format":"int32"},"id":{"type":"integer","description":"The unique identifier of the identity. Only provide a value when updating.","format":"int64","nullable":true},"identityRules":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyIdentityRuleSaveModel"},"description":"The list of identity rules","nullable":true},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the identity"}},"additionalProperties":false},"ApiPolicyIdentityRuleSaveModel":{"required":["claim"],"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/ApiAccessRuleType"},"claim":{"type":"string","description":"The claim associated with the identity rule"},"value":{"type":"string","description":"The value associated with the identity rule","nullable":true},"matchType":{"$ref":"#/components/schemas/IdentityRuleMatchType"}},"additionalProperties":false},"ApiAccessRuleType":{"enum":["Allow","Deny"],"type":"string"},"IdentityRuleMatchType":{"enum":["Exact","Exists","Regex"],"type":"string"},"ApiPolicyDeploymentSaveModel":{"required":["agentGroupName"],"type":"object","properties":{"agentGroupName":{"type":"string","description":"The Agent Group associated with the deployment"}},"additionalProperties":false},"ApiPolicyApiKeyGroupSaveModel":{"required":["apiPolicyApiKeyGroupAssignments","name"],"type":"object","properties":{"requestLimit":{"type":"integer","description":"The maximum amount of requests. Not null value requires RequestLimitWindowInMinutes to be set.","format":"int32","nullable":true},"requestLimitWindowInMinutes":{"type":"integer","description":"The request limit window in minutes. Not null value requires RequestLimit to be set.","format":"int32","nullable":true},"name":{"type":"string","description":"The name of the API key group"},"apiPolicyApiKeyGroupAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyApiKeyGroupAssignmentSaveModel"},"description":"The API key group assignments"}},"additionalProperties":false},"ApiPolicyApiKeyGroupAssignmentSaveModel":{"required":["apiKey"],"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiPolicyApiKeySaveModel"}},"additionalProperties":false},"ApiPolicyApiKeySaveModel":{"type":"object","properties":{"id":{"type":"integer","description":"The API key identifier","format":"int64"}},"additionalProperties":false},"ApiPolicyRequestLoggingSaveModel":{"required":["deployments","loggingFields","name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the request logging"},"loggingFields":{"type":"array","items":{"type":"string"},"description":"The fields logged by request logging"},"ipLogging":{"$ref":"#/components/schemas/IpLoggingType"},"requestBodyMaxLengthKb":{"type":"integer","description":"Request body maximum length for request logging","format":"int32"},"responseBodyMaxLengthKb":{"type":"integer","description":"Response body maximum length for request logging","format":"int32"},"disableLogging":{"type":"boolean","description":"Disable logging for request logging"},"id":{"type":"integer","description":"The unique identifier of the request logging. Only provide a value when updating.","format":"int64","nullable":true},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/ApiPolicyDeploymentSaveModel"},"description":"The list of deployments associated with the request logging"}},"additionalProperties":false},"IpLoggingType":{"enum":["ClientIP","ClientIPXForwardedForFirst","ClientIPXForwardedForAll","Disable"],"type":"string"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/api-policies/{id}":{"put":{"tags":["ApiPolicies"],"summary":"Update an API policy","parameters":[{"name":"id","in":"path","description":"API policy identifier","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiPolicySaveModel"}}}},"responses":{"204":{"description":"API policy updated"},"400":{"description":"API policy is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"API policy not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"API policy contains endpoint that is already registered in existing policy","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## DELETE /api/v1/api-policies/{id}

> Delete an API policy

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/api-policies/{id}":{"delete":{"tags":["ApiPolicies"],"summary":"Delete an API policy","parameters":[{"name":"id","in":"path","description":"API policy identifier","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"API policy deleted"},"404":{"description":"API policy not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.frends.com/reference/frends-platform-api/platform-api-reference/apipolicies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
