

# Applications applicationId Policy


## URI


`/applications/applicationId/policy`

## HTTP methods


### GET


**Operation ID:** `GetApplicationPolicy`

Retrieves the policy for the application.


**Path parameters**  

| Name | Type | Required | Description | 
| --- |--- |--- |--- |
| applicationId | String | True | The Amazon Resource Name (ARN) of the application. | 


**Responses**  

| Status code | Response model | Description | 
| --- |--- |--- |
| 200 | ApplicationPolicy | Success | 
| 400 | BadRequestException | One of the parameters in the request is invalid. | 
| 403 | ForbiddenException | The client is not authenticated. | 
| 404 | NotFoundException | The resource (for example, an access policy statement) specified in the request doesn't exist. | 
| 429 | TooManyRequestsException | The client is sending more than the allowed number of requests per unit of time. | 
| 500 | InternalServerErrorException | The Amazon Serverless Application Repository service encountered an internal error. | 

### PUT


**Operation ID:** `PutApplicationPolicy`

Sets the permission policy for an application. For the list of actions supported for this operation, see [Application Permissions](https://docs.amazonaws.cn/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions) .


**Path parameters**  

| Name | Type | Required | Description | 
| --- |--- |--- |--- |
| applicationId | String | True | The Amazon Resource Name (ARN) of the application. | 


**Responses**  

| Status code | Response model | Description | 
| --- |--- |--- |
| 200 | ApplicationPolicy | Success | 
| 400 | BadRequestException | One of the parameters in the request is invalid. | 
| 403 | ForbiddenException | The client is not authenticated. | 
| 404 | NotFoundException | The resource (for example, an access policy statement) specified in the request doesn't exist. | 
| 429 | TooManyRequestsException | The client is sending more than the allowed number of requests per unit of time. | 
| 500 | InternalServerErrorException | The Amazon Serverless Application Repository service encountered an internal error. | 

### OPTIONS



**Path parameters**  

| Name | Type | Required | Description | 
| --- |--- |--- |--- |
| applicationId | String | True | The Amazon Resource Name (ARN) of the application. | 


**Responses**  

| Status code | Response model | Description | 
| --- |--- |--- |
| 200 | None | 200 response | 

## Schemas


### Request bodies


#### PUT schema
PUT

```
{
  "statements": [
    {
      "statementId": "string",
      "principals": [
        "string"
      ],
      "actions": [
        "string"
      ],
      "principalOrgIDs": [
        "string"
      ]
    }
  ]
}
```

### Response bodies


#### ApplicationPolicy schema
ApplicationPolicy

```
{
  "statements": [
    {
      "statementId": "string",
      "principals": [
        "string"
      ],
      "actions": [
        "string"
      ],
      "principalOrgIDs": [
        "string"
      ]
    }
  ]
}
```

#### BadRequestException schema
BadRequestException

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### ForbiddenException schema
ForbiddenException

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### NotFoundException schema
NotFoundException

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### TooManyRequestsException schema
TooManyRequestsException

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### InternalServerErrorException schema
InternalServerErrorException

```
{
  "message": "string",
  "errorCode": "string"
}
```

## Properties


### ApplicationPolicy


Policy statements applied to the application.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| statements | Array of type [ApplicationPolicyStatement](#applications-applicationid-policy-model-applicationpolicystatement) | True | An array of policy statements applied to the application. | 

### ApplicationPolicyStatement


Policy statement applied to the application.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| actions | Array of type string | True | For the list of actions supported for this operation, see [Application Permissions](https://docs.amazonaws.cn/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions). | 
| principalOrgIDs | Array of type string | False | The Amazon Organizations ID to share the application with. | 
| principals | Array of type string | True | An array of Amazon account IDs to share the application with, or \$1 to make the application public. | 
| statementId | string | False | A unique ID for the statement. | 

### BadRequestException


One of the parameters in the request is invalid.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 400 | 
| message | string | False | One of the parameters in the request is invalid. | 

### ForbiddenException


The client is not authenticated.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 403 | 
| message | string | False | The client is not authenticated. | 

### InternalServerErrorException


The Amazon Serverless Application Repository service encountered an internal error.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 500 | 
| message | string | False | The Amazon Serverless Application Repository service encountered an internal error. | 

### NotFoundException


The resource (for example, an access policy statement) specified in the request doesn't exist.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 404 | 
| message | string | False | The resource (for example, an access policy statement) specified in the request doesn't exist. | 

### TooManyRequestsException


The client is sending more than the allowed number of requests per unit of time.


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 429 | 
| message | string | False | The client is sending more than the allowed number of requests per unit of time. | 