Assign race divisions to registrants. Only divisions without auto-select criteria can be assigned. The divisions posted will completely replace previous divisions for the registrant. To remove all divisions for a registrant, send the registration id with no divisions.
For JSON requests, the request should look like the example below.
{
	"assignments": [
		{
			"registration_id": 123,
			"race_division_ids": [ 1, 2 ]
		},
		{
			"registration_id": 456,
			"race_division_ids": [ 2 ]
		}
	]
}
For XML requests, the request should look like the example below.
<?xml version="1.0" encoding="utf-8" ?> <request> <assignment> <registration_id>123</registration_id> <race_division_id>1</race_division_id> <race_division_id>2</race_division_id> </assignment> <assignment> <registration_id>456</registration_id> <race_division_id>2</race_division_id> </assignment> </request>
| Parameter | HTTP Method | Default | Description | Datatype | 
|---|---|---|---|---|
| api_key | GET | API Key | string | |
| api_secret | GET | API Secret | string | |
| rsu_api_key | GET | API v2 key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET. | string | |
| sp_api_key | GET | Super partner API key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET. | string | |
| X-RSU-API-SECRET | HTTP Header | API v2 or super partner secret. | string | |
| Authorization | HTTP Header | Authorization Header. If using OAuth 2.0, fill this in with `Bearer <token>`. | string | |
| format | GET | xml | Format of response. The default if not sent is `xml`, but `json` is preferred. | format | 
| Parameter | HTTP Method | Default | Description | Datatype | 
|---|---|---|---|---|
| race_idRequired | POST | ID of race. | uint | |
| event_idRequired | POST | ID of event. | uint | |
| request_format | POST | xml | Format of request. The default if not sent is `xml`, but `json` is preferred. | format | 
| requestRequired | POST | Request in proper format. | string | 
{
    "openapi": "3.0.3",
    "info": {
        "title": "Post Race Division Assignments",
        "description": "Assign race divisions to registrants.",
        "version": "1.0.0",
        "contact": {
            "name": "RunSignup API Support",
            "url": "https://runsignup.com/API",
            "email": "info@runsignup.com"
        }
    },
    "servers": [
        {
            "url": "https://api.runsignup.com/rest",
            "description": "Production API Server"
        }
    ],
    "tags": [
        {
            "name": "Race Divisions",
            "description": "APIs related to Race Divisions"
        }
    ],
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "description": "Error message"
                    },
                    "details": {
                        "type": "object",
                        "description": "Additional error details",
                        "additionalProperties": true
                    }
                },
                "required": [
                    "error"
                ]
            },
            "BadRequestError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating invalid request parameters or structure"
                    }
                ]
            },
            "UnauthorizedError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating authentication failure"
                    }
                ]
            },
            "ForbiddenError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating the authenticated user lacks required permissions"
                    }
                ]
            },
            "NotFoundError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating the requested resource does not exist"
                    }
                ]
            },
            "ServerError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating an unexpected server-side issue"
                    }
                ]
            }
        },
        "securitySchemes": {
            "apiKey": {
                "type": "apiKey",
                "in": "query",
                "name": "api_key",
                "description": "RunSignup API Key"
            },
            "apiSecret": {
                "type": "apiKey",
                "in": "query",
                "name": "api_secret",
                "description": "RunSignup API Secret"
            }
        }
    },
    "paths": {
        "/race/{race_id}/divisions/assign-divisions": {
            "post": {
                "tags": [
                    "Race Divisions"
                ],
                "summary": "Post Race Division Assignments",
                "description": "Assign race divisions to registrants.",
                "operationId": "race_:race_id_divisions_assign_divisions",
                "parameters": [
                    {
                        "name": "race_id",
                        "in": "path",
                        "description": "Path parameter: race_id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "api_key",
                        "in": "query",
                        "description": "API Key",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "api_secret",
                        "in": "query",
                        "description": "API Secret",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rsu_api_key",
                        "in": "query",
                        "description": "API v2 key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sp_api_key",
                        "in": "query",
                        "description": "Super partner API key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-RSU-API-SECRET",
                        "in": "header",
                        "description": "API v2 or super partner secret.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Authorization",
                        "in": "header",
                        "description": "Authorization Header. If using OAuth 2.0, fill this in with `Bearer <token>`.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Format of response. The default if not sent is `xml`, but `json` is preferred.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "xml",
                                "json",
                                "csv"
                            ],
                            "default": "xml"
                        }
                    },
                    {
                        "name": "event_id",
                        "in": "query",
                        "description": "ID of event.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "security": [
                    {
                        "apiKey": [],
                        "apiSecret": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BadRequestError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UnauthorizedError"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ForbiddenError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundError"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServerError"
                                }
                            }
                        }
                    }
                },
                "x-permissions": [
                    "partners",
                    "race_directors",
                    "timers"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "request_format": {
                                        "type": "string",
                                        "enum": [
                                            "xml",
                                            "json",
                                            "csv"
                                        ],
                                        "default": "xml"
                                    },
                                    "request": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "request"
                                ]
                            }
                        }
                    }
                }
            }
        }
    }
}