Amazon IAM Iam User Policy API

The Iam User Policy API from Amazon IAM — 6 operation(s) for iam user policy.

GitHub OpenAPI
Business capability
Identity & Access Management BC-620.20

Operations 6

POST /?Action=AttachUserPolicy Attach User Policy #
POST /?Action=DeleteUserPolicy Delete User Policy #
POST /?Action=DetachUserPolicy Detach User Policy #
POST /?Action=GetUserPolicy Get User Policy #
POST /?Action=ListUserPolicies List User Policies #
POST /?Action=PutUserPolicy Put User Policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-iam:amazon-iam-user-policy-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-iam-user-policy-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AWS Identity and Access Management User Policy API
  version: '2010-05-08'
  description: Generated from AWS's published Smithy model for AWS Identity and Access Management. 6 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://iam.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /?Action=AttachUserPolicy:
    post:
      operationId: AttachUserPolicy
      summary: Attach User Policy
      description: Attaches the specified managed policy to the specified user. You use this operation to attach a managed
        policy to a user. To embed an inline policy in a user, use PutUserPolicy . As a best practice, you can validate your
        IAM policies. To learn more, see Validating IAM policies in the IAM User Guide. For more information about policies,
        see Managed policies and inline policies in the IAM User Guide.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
        '400':
          description: InvalidInputException; PolicyNotAttachableException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '409':
          description: LimitExceededException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: AttachUserPolicy
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/AttachUserPolicyRequest'
            example:
              UserName: Alice
              PolicyArn: arn:aws:iam::aws:policy/AdministratorAccess
      tags:
      - User Policy
  /?Action=DeleteUserPolicy:
    post:
      operationId: DeleteUserPolicy
      summary: Delete User Policy
      description: Deletes the specified inline policy that is embedded in the specified IAM user. A user can also have managed
        policies attached to it. To detach a managed policy from a user, use DetachUserPolicy. For more information about
        policies, refer to Managed policies and inline policies in the IAM User Guide.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
        '409':
          description: LimitExceededException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: DeleteUserPolicy
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/DeleteUserPolicyRequest'
            example:
              UserName: Juan
              PolicyName: ExamplePolicy
      tags:
      - User Policy
  /?Action=DetachUserPolicy:
    post:
      operationId: DetachUserPolicy
      summary: Detach User Policy
      description: Removes the specified managed policy from the specified user. A user can also have inline policies embedded
        with it. To delete an inline policy, use DeleteUserPolicy. For information about policies, see Managed policies and
        inline policies in the IAM User Guide.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
        '400':
          description: InvalidInputException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/InvalidInputException'
        '409':
          description: LimitExceededException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: DetachUserPolicy
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/DetachUserPolicyRequest'
      tags:
      - User Policy
  /?Action=GetUserPolicy:
    post:
      operationId: GetUserPolicy
      summary: Get User Policy
      description: Retrieves the specified inline policy document that is embedded in the specified IAM user. Policies returned
        by this operation are URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy
        back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility
        class in the Java SDK. Other languages and SDKs provide similar functionality, and some SDKs do this decoding automatically.
        An IAM user can also have managed policies attached to it. To retrieve a managed policy document that is attached
        to a user, use GetPolicy to determine the policy's default version. Then use GetPolicyVersion to retrieve the policy
        document. For more information about policies, see Managed policies and inline policies in the IAM User Guide.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/GetUserPolicyResponse'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: GetUserPolicy
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/GetUserPolicyRequest'
      tags:
      - User Policy
  /?Action=ListUserPolicies:
    post:
      operationId: ListUserPolicies
      summary: List User Policies
      description: Lists the names of the inline policies embedded in the specified IAM user. An IAM user can also have managed
        policies attached to it. To list the managed policies that are attached to a user, use ListAttachedUserPolicies. For
        more information about policies, see Managed policies and inline policies in the IAM User Guide. You can paginate
        the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified
        user, the operation returns an empty list.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ListUserPoliciesResponse'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: ListUserPolicies
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/ListUserPoliciesRequest'
      tags:
      - User Policy
  /?Action=PutUserPolicy:
    post:
      operationId: PutUserPolicy
      summary: Put User Policy
      description: Adds or updates an inline policy document that is embedded in the specified IAM user. An IAM user can also
        have a managed policy attached to it. To attach a managed policy to a user, use AttachUserPolicy . To create a new
        managed policy, use CreatePolicy . For information about policies, see Managed policies and inline policies in the
        IAM User Guide. For information about the maximum number of inline policies that you can embed in a user, see IAM
        and STS quotas in the IAM User Guide. Because policy documents can be large, you should use POST rather than GET when
        calling PutUserPolicy. For general information about using the Query API with IAM, see Making query requests in the
        IAM User Guide.
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
        '409':
          description: LimitExceededException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
        '400':
          description: MalformedPolicyDocumentException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/MalformedPolicyDocumentException'
        '404':
          description: NoSuchEntityException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/NoSuchEntityException'
        '500':
          description: ServiceFailureException
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ServiceFailureException'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
              - type: object
                required:
                - Action
                - Version
                properties:
                  Action:
                    type: string
                    const: PutUserPolicy
                  Version:
                    type: string
                    const: '2010-05-08'
              - $ref: '#/components/schemas/PutUserPolicyRequest'
            example:
              UserName: Bob
              PolicyName: AllAccessPolicy
              PolicyDocument: '{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"*","Resource":"*"}}'
      tags:
      - User Policy
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: iam
  schemas:
    AttachUserPolicyRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name (friendly name, not ARN) of the IAM user to attach the policy to. This parameter allows (through
            its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces.
            You can also include any of the following characters: _+=,.@-'
        PolicyArn:
          type: string
          description: The Amazon Resource Name (ARN) of the IAM policy you want to attach. For more information about ARNs,
            see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
      required:
      - UserName
      - PolicyArn
    DeleteUserPolicyRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name (friendly name, not ARN) identifying the user that the policy is embedded in. This parameter
            allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters
            with no spaces. You can also include any of the following characters: _+=,.@-'
        PolicyName:
          type: string
          description: 'The name identifying the policy document to delete. This parameter allows (through its regex pattern)
            a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also
            include any of the following characters: _+=,.@-'
      required:
      - UserName
      - PolicyName
    DetachUserPolicyRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name (friendly name, not ARN) of the IAM user to detach the policy from. This parameter allows
            (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with
            no spaces. You can also include any of the following characters: _+=,.@-'
        PolicyArn:
          type: string
          description: The Amazon Resource Name (ARN) of the IAM policy you want to detach. For more information about ARNs,
            see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
      required:
      - UserName
      - PolicyArn
    GetUserPolicyRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name of the user who the policy is associated with. This parameter allows (through its regex pattern)
            a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also
            include any of the following characters: _+=,.@-'
        PolicyName:
          type: string
          description: 'The name of the policy document to get. This parameter allows (through its regex pattern) a string
            of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any
            of the following characters: _+=,.@-'
      required:
      - UserName
      - PolicyName
    GetUserPolicyResponse:
      type: object
      properties:
        UserName:
          type: string
          description: The user the policy is associated with.
        PolicyName:
          type: string
          description: The name of the policy.
        PolicyDocument:
          type: string
          description: The policy document. IAM stores policies in JSON format. However, resources that were created using
            CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format
            before submitting it to IAM.
      required:
      - UserName
      - PolicyName
      - PolicyDocument
    InvalidInputException:
      type: object
      properties:
        message:
          type: string
    LimitExceededException:
      type: object
      properties:
        message:
          type: string
    ListUserPoliciesRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name of the user to list policies for. This parameter allows (through its regex pattern) a string
            of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any
            of the following characters: _+=,.@-'
        Marker:
          type: string
          description: Use this parameter only when paginating results and only after you receive a response indicating that
            the results are truncated. Set it to the value of the Marker element in the response that you received to indicate
            where the next call should start.
        MaxItems:
          type: integer
          description: Use this only when paginating results to indicate the maximum number of items you want in the response.
            If additional items exist beyond the maximum you specify, the IsTruncated response element is true. If you do
            not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even
            when there are more results available. In that case, the IsTruncated response element returns true, and Marker
            contains a value to include in the subsequent call that tells the service where to continue from.
      required:
      - UserName
    ListUserPoliciesResponse:
      type: object
      properties:
        PolicyNames:
          type: array
          items:
            type: string
          description: A list of policy names.
        IsTruncated:
          type: boolean
          description: A flag that indicates whether there are more items to return. If your results were truncated, you can
            make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM
            might return fewer than the MaxItems number of results even when there are more results available. We recommend
            that you check IsTruncated after every call to ensure that you receive all your results.
        Marker:
          type: string
          description: When IsTruncated is true, this element is present and contains the value to use for the Marker parameter
            in a subsequent pagination request.
      required:
      - PolicyNames
    MalformedPolicyDocumentException:
      type: object
      properties:
        message:
          type: string
    NoSuchEntityException:
      type: object
      properties:
        message:
          type: string
    PutUserPolicyRequest:
      type: object
      properties:
        UserName:
          type: string
          description: 'The name of the user to associate the policy with. This parameter allows (through its regex pattern)
            a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also
            include any of the following characters: _+=,.@-'
        PolicyName:
          type: string
          description: 'The name of the policy document. This parameter allows (through its regex pattern) a string of characters
            consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following
            characters: _+=,.@-'
        PolicyDocument:
          type: string
          description: 'The policy document. You must provide policies in JSON format in IAM. However, for CloudFormation
            templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts
            a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is
            a string of characters consisting of the following: Any printable ASCII character ranging from the space character
            (\u0020) through the end of the ASCII character range The printable characters in the Basic Latin and Latin-1
            Supplement character set (through \u00FF) The special c'
      required:
      - UserName
      - PolicyName
      - PolicyDocument
    ServiceFailureException:
      type: object
      properties:
        message:
          type: string
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/iam/service/2010-05-08/iam-2010-05-08.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)