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

# Auto-Approve Affiliate to Campaigns

Changes to the Relationship between Advertiser and Affiliate on the network platform are replicated to the Invoca platform using this API. The operations on Advertiser‐Affiliate Relationships are similar to Network, in that the interface is fully idempotent, and the create and update commands will act as “create or update”.

When setting the Relationship between an Advertiser and Affiliate to Approved, all current and future campaign applications made between the Affiliate and Advertiser will be auto-approved. If the Relationship is set to any status other than Approved, all current and future applications will be declined and any active affiliate campaigns will be suspended.

Relationship status is set individually but reading is available for one or all relationships for an advertiser.

Parameters for the relationships are shown below

| Property | Type | Value |
| - | - | - |
| affiliate\_id\_from\_network | string | The network id for the affiliate. (read only) |
| status | One of: Pending, Approved, Suspended, Declined, Deactivated | Status of the advertiser ‐ affiliate relationship. |

Endpoint:

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/affiliates/<affiliate_id_from_network>.json`

> [accordion] Get all Advertiser-Affiliate relationships
>
> #### Examples
>
> Read all relationships for advertiser id from network 1
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/1/affiliates.json`
>
> Format: application/json
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> [
>   {
>     "status": "Approved",
>     "affiliate_id_from_network": "222"
>   },
>   {
>     "status": "Approved",
>     "affiliate_id_from_network": "34518"
>   }
> ]
> ```

> [accordion] Get an Advertiser-Affiliate relationship
>
> #### Examples
>
> Read a single relationship
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/1/affiliates/222.json`
>
> Format: application/json
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "status": "Approved",
>   "affiliate_id_from_network": "222"
> }
> ```

> [accordion] Create an Advertiser-Affiliate relationship
>
> #### Examples
>
> Create relationship between Advertiser id from network 1 and Affiliate id from network 222
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/1/affiliates/222.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "status": "Approved"
> }
> ```
>
> Response Code: 201
>
> Response Body:
>
> ```json theme={null}
> {
> }
> ```

> [accordion] Update an Advertiser-Affiliate relationship
>
> #### Examples
>
> Update an Advertiser-Affiliate relationship with id from network 1 and Affiliate id from network 222
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/1/affiliates/222.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "status": "Approved"
> }
> ```
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
> }
> ```

> [accordion] Delete an Advertiser-Affiliate relationship
>
> #### Examples
>
> Delete a relationship
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/1/affiliates/222.json`
>
> Response Code: 200


## Related topics

- [Network Integration](https://docs.invoca.com/en/latest/api_documentation/network_integration/index.md)
- [How to Approve a Publisher to Your Affiliate Campaign](https://docs.invoca.com/s/article/approve-publisher-affiliate-campaign.md)
- [How to Change Your Campaign's Visibility to Specific Publishers](https://docs.invoca.com/s/article/change-campaign-visibility-publishers.md)
- [Affiliate Campaigns](https://docs.invoca.com/en/latest/api_documentation/network_integration/affiliate_campaigns/index.md)
- [Advertiser Campaigns](https://docs.invoca.com/en/latest/api_documentation/network_integration/advertiser_campaigns/index.md)
