# Update organization details (to accept an invitation).

patch ` https://app.mk.io/api/v1/user/organizations/:organization_id`

The only field that can be modified is the invite state, and that should be set to 'accepted' to accept a 'pending' invitation to work with a new organization. To decline a pending invitation, use the DELETE method instead.

Requires authentication; no additional RBAC permissions required.

## Authentication

Authorization Bearer

Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Path parameters

- **organization_id**: string, Required, format: uuid

## Request

This endpoint expects an object.

- **spec**: object [UserOrganizationSpecSchema](https://docs.mediakind.com/api-reference/management-api/schemas/userorganizationspecschema) Optional  
  Specification.

- **invite**: object [UserOrganizationPendingInviteSchema](https://docs.mediakind.com/api-reference/management-api/schemas/userorganizationpendinginviteschema) Optional  
  Pending invitation to work with this organization.
  - **state**: enum, Required  
    State of the invite.  
    Allowed values: accepted, pending

## Response

200 OK

- **kind**: string, Optional  
  The kind of record.
- **metadata**: object [UserOrganizationMetadataSchema](https://docs.mediakind.com/api-reference/management-api/schemas/userorganizationmetadataschema) Optional  
  Metadata.
  - **id**: string, Required, format: uuid  
    ID of the organization.
  - **name**: string, Required  
    Name of the organization.
  - **spec**: object [UserOrganizationSpecSchema](https://docs.mediakind.com/api-reference/management-api/schemas/userorganizationspecschema) Optional  
    Specification.
  - **invite**: object [UserOrganizationPendingInviteSchema](https://docs.mediakind.com/api-reference/management-api/schemas/userorganizationpendinginviteschema) Optional  
    Pending invitation to work with this organization.
    - **comment**: string, Required  
      Comment from the inviter.
    - **invitedBy**: string or null, Required  
      Email of the user who sent the invite.
    - **state**: enum, Required  
      State of the invite.  
      Allowed values: accepted, pending

## Errors

- **400 Bad Request**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.

- **401 Unauthorized**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.

- **403 Forbidden**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.

- **404 Not Found**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.

- **429 Too Many Requests**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.

- **500 Internal Server Error**
  - **error**: object [ErrorDetail](https://docs.mediakind.com/api-reference/management-api/schemas/errordetail) Required  
    Pertinent information about the error  
    - **code**: string, Required  
    The error code.  
    - **detail**: string, Required  
    The error message.  
    - **extraDetail**: map from strings to any, Optional  
    Extra information regarding this error.  
    - **ref**: string, Required  
    A reference to the request that caused the error.  
    - **status**: integer, Required  
    The HTTP status code.
