> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kiwify.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Editar afiliado

> Editar informações de um afiliado específico, passando o affiliate_id.



## OpenAPI

````yaml put /affiliates/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: API Kiwify
  description: ''
servers:
  - url: https://public-api.kiwify.com/v1/
    description: base
security: []
tags:
  - name: Autenticação
  - name: Conta
  - name: Produtos
  - name: Vendas
  - name: Financeiro
  - name: Affiliados
  - name: Webhooks
  - name: Eventos
paths:
  /affiliates/{id}:
    put:
      tags:
        - Affiliados
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AffiliateRequest'
      responses:
        '200':
          description: Affiliate data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
              examples:
                Affiliate:
                  summary: Affiliate example
                  value:
                    affiliate_id: c52ccea4-2b5a-4d03-b53a-d9dc96756fc0
                    name: MY Affiliate
                    email: myaffiliate@mail.com
                    company_name: MY Affiliate
                    director_cpf: '99999999999'
                    company_cnpj: ''
                    product:
                      id: aaa86f40-d7ae-11ed-acc6-e1c45591a30e
                      name: My Product
                    commission: 4600
                    status: active
                    created_at: '2023-07-24T15:56:26.189Z'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorResponse'
              examples:
                InvalidClient:
                  value:
                    error: auth_error
                    message: 'Invalid token: access token is invalid'
          description: Solicitação Inválida
        '404':
          description: Não Encontrado
      security:
        - AccountIdHeader: []
          OAuth2:
            - affiliates
components:
  schemas:
    AffiliateRequest:
      type: object
      properties:
        commission:
          type: number
          example: 4600
        status:
          type: string
          enum:
            - active
            - blocked
            - refused
          example: active
    Affiliate:
      type: object
      properties:
        affiliate_id:
          type: string
          example: 3d103172-04b3-44ef-b2b2-ef0f97db4f37
        name:
          type: string
          example: Meu Afiliado
        email:
          type: string
          example: meuafiliado@gmail.com
        company_name:
          type: string
          example: Meu afiliado
        director_cpf:
          type: string
          example: '99999999999'
        company_cnpj:
          type: string
          example: '99999999999999'
        product:
          type: object
          properties:
            id:
              type: string
              example: dddfd7d0-82e4-427e-911a-ea0625a42e17
            name:
              type: string
              example: Meu Produto
        commission:
          type: number
          example: 4600
        status:
          type: string
          example: active
        created_at:
          type: string
          example: '2023-07-24T15:56:26.189Z'
    OAuthErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: auth_error
        message:
          type: string
          example: 'Invalid client: client is invalid'
  securitySchemes:
    AccountIdHeader:
      type: apiKey
      in: header
      name: x-kiwify-account-id
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes:
            stats: stats
            products: products
            events: events
            sales: sales
            sales_refund: sales_refund
            financial: financial
            affiliates: affiliates
            webhooks: webhooks

````