{
    "openapi": "3.0.3",
    "info": {
        "title": "Get Fundraisers for Races",
        "description": "Get list of race fundraisers.",
        "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 Fundraisers",
            "description": "APIs related to Race Fundraisers"
        }
    ],
    "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"
                    }
                ]
            },
            "V2RaceFundraisersGetRaceFundraisersGetResponse": {
                "type": "object",
                "title": "Race Fundraisers Response",
                "description": "Response containing list of race fundraisers. Additional fields are included based on request parameters.",
                "properties": {
                    "race_fundraisers": {
                        "type": "array",
                        "description": "List of race fundraisers. The response includes additional fields when certain parameters are set to true.",
                        "items": {
                            "type": "object",
                            "description": "Details about a race fundraiser",
                            "properties": {
                                "race_fundraiser_id": {
                                    "type": "integer",
                                    "description": "Unique identifier for the race fundraiser"
                                },
                                "race_fundraiser_name": {
                                    "type": "string",
                                    "description": "Name of the race fundraiser"
                                },
                                "parent_fundraiser_id": {
                                    "type": "integer",
                                    "description": "ID of the parent fundraiser if this is a child fundraiser",
                                    "nullable": true
                                },
                                "created_ts": {
                                    "type": "integer",
                                    "description": "Timestamp when the fundraiser was created",
                                    "nullable": true
                                },
                                "registration_id": {
                                    "type": "integer",
                                    "description": "Associated registration ID",
                                    "nullable": true
                                },
                                "is_team_fundraiser": {
                                    "type": "string",
                                    "description": "Whether this is a team fundraiser",
                                    "enum": [
                                        "T",
                                        "F"
                                    ]
                                },
                                "fundraiser_hidden": {
                                    "type": "string",
                                    "description": "Whether the fundraiser is hidden",
                                    "enum": [
                                        "T",
                                        "F"
                                    ]
                                },
                                "fundraiser_url": {
                                    "type": "string",
                                    "description": "Public URL for the fundraiser"
                                },
                                "fundraiser_token": {
                                    "type": "string",
                                    "description": "Unique token for the fundraiser"
                                },
                                "fundraiser_owner": {
                                    "type": "object",
                                    "description": "Information about the fundraiser owner",
                                    "properties": {
                                        "user_id": {
                                            "type": "integer",
                                            "description": "User ID of the fundraiser owner"
                                        },
                                        "first_name": {
                                            "type": "string",
                                            "description": "First name of the fundraiser owner"
                                        },
                                        "last_name": {
                                            "type": "string",
                                            "description": "Last name of the fundraiser owner"
                                        },
                                        "email": {
                                            "type": "string",
                                            "description": "Email address of the fundraiser owner",
                                            "nullable": true
                                        },
                                        "phone_number": {
                                            "type": "string",
                                            "description": "Phone number of the fundraiser owner",
                                            "nullable": true
                                        }
                                    },
                                    "required": [
                                        "user_id",
                                        "first_name",
                                        "last_name"
                                    ]
                                },
                                "charity_id": {
                                    "type": "integer",
                                    "description": "ID of the associated charity",
                                    "nullable": true
                                },
                                "charity_name": {
                                    "type": "string",
                                    "description": "Name of the associated charity",
                                    "nullable": true
                                },
                                "fundraiser_tagline": {
                                    "type": "string",
                                    "description": "Tagline for the fundraiser",
                                    "nullable": true
                                },
                                "personal_message": {
                                    "type": "string",
                                    "description": "Personal message from the fundraiser",
                                    "nullable": true
                                },
                                "fundraising_goal": {
                                    "type": "string",
                                    "description": "Fundraising goal amount",
                                    "format": "currency",
                                    "x-currency-symbol": "$",
                                    "x-decimal-places": 2,
                                    "pattern": "^\\$\\d+\\.\\d{2}$"
                                },
                                "fundraising_minimum": {
                                    "type": "string",
                                    "description": "Minimum fundraising amount required",
                                    "format": "currency",
                                    "x-currency-symbol": "$",
                                    "x-decimal-places": 2,
                                    "pattern": "^\\$\\d+\\.\\d{2}$"
                                },
                                "donation_period_id": {
                                    "type": "integer",
                                    "description": "ID of the donation period"
                                },
                                "applied_for_refund": {
                                    "type": "string",
                                    "description": "Whether a refund has been applied for",
                                    "enum": [
                                        "T",
                                        "F"
                                    ]
                                },
                                "last_modified_ts": {
                                    "type": "integer",
                                    "description": "Timestamp of last modification"
                                },
                                "last_modified_or_donation_amount_change_ts": {
                                    "type": "integer",
                                    "description": "Timestamp of last modification or donation amount change"
                                },
                                "amount_raised": {
                                    "type": "string",
                                    "description": "Total amount raised by the fundraiser. Present when include_amount_raised=T",
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_amount_raised",
                                            "value": "T"
                                        }
                                    ],
                                    "format": "currency",
                                    "x-currency-symbol": "$",
                                    "x-decimal-places": 2,
                                    "pattern": "^\\$\\d+\\.\\d{2}$"
                                },
                                "number_of_donations": {
                                    "type": "integer",
                                    "description": "Number of donations received. Present when include_number_of_donations=T",
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_number_of_donations",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "fundraiser_primary_image_filename": {
                                    "type": "string",
                                    "description": "URL to the fundraiser's primary image. Present when include_fundraiser_profile_images=T",
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_fundraiser_profile_images",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "team_fundraiser_type_id": {
                                    "type": "integer",
                                    "description": "ID of the team fundraiser type. Present when include_fundraiser_type_info=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_fundraiser_type_info",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "team_fundraiser_type": {
                                    "type": "string",
                                    "description": "Team fundraiser type details. Present when include_fundraiser_type_info=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_fundraiser_type_info",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "umbrella_team_id": {
                                    "type": "integer",
                                    "description": "ID of the umbrella team. Present when include_umbrella_teams=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_umbrella_teams",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "umbrella_team_name": {
                                    "type": "string",
                                    "description": "Name of the umbrella team. Present when include_umbrella_teams=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_umbrella_teams",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "external_fundraiser_id": {
                                    "type": "string",
                                    "description": "External fundraiser ID. Present when include_external_fundraiser_ids=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_external_fundraiser_ids",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "minimum_commitment_level_id": {
                                    "type": "integer",
                                    "description": "ID of the minimum commitment level. Present when include_minimum_commitment_data=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_minimum_commitment_data",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "minimum_commitment_level_name": {
                                    "type": "string",
                                    "description": "Name of the minimum commitment level. Present when include_minimum_commitment_data=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_minimum_commitment_data",
                                            "value": "T"
                                        }
                                    ]
                                },
                                "minimum_commitment_level_amount": {
                                    "type": "string",
                                    "description": "Amount of the minimum commitment level. Present when include_minimum_commitment_data=T",
                                    "nullable": true,
                                    "x-response-field-inclusion": [
                                        {
                                            "request-parameter": "include_minimum_commitment_data",
                                            "value": "T"
                                        }
                                    ],
                                    "format": "currency",
                                    "x-currency-symbol": "$",
                                    "x-decimal-places": 2,
                                    "pattern": "^\\$\\d+\\.\\d{2}$"
                                }
                            },
                            "required": [
                                "race_fundraiser_id",
                                "race_fundraiser_name",
                                "is_team_fundraiser",
                                "fundraiser_hidden",
                                "fundraiser_url",
                                "fundraiser_token",
                                "fundraiser_owner",
                                "fundraising_goal",
                                "fundraising_minimum",
                                "donation_period_id",
                                "applied_for_refund",
                                "last_modified_ts",
                                "last_modified_or_donation_amount_change_ts"
                            ]
                        }
                    }
                },
                "required": [
                    "race_fundraisers"
                ],
                "example": {
                    "race_fundraisers": [
                        {
                            "race_fundraiser_id": 123,
                            "race_fundraiser_name": "Some Fundraiser Name",
                            "parent_fundraiser_id": 567,
                            "created_ts": 1715704200,
                            "registration_id": 1234,
                            "is_team_fundraiser": "F",
                            "fundraiser_hidden": "T",
                            "fundraiser_url": "https://runsignup.com/SomeFundraiserName",
                            "fundraiser_token": "a1b2c3d4e",
                            "fundraiser_owner": {
                                "user_id": 123,
                                "first_name": "John",
                                "last_name": "Doe",
                                "email": "example@example.com",
                                "phone_number": "555-555-5555"
                            },
                            "charity_id": 123,
                            "charity_name": "Charity Name",
                            "fundraiser_tagline": "This is a tagline.",
                            "personal_message": "Some personal message.",
                            "fundraising_goal": "$500.00",
                            "fundraising_minimum": "$250.00",
                            "amount_raised": "$250.00",
                            "donation_period_id": 1,
                            "applied_for_refund": "F",
                            "last_modified_ts": 1715704200,
                            "last_modified_or_donation_amount_change_ts": 1715704200,
                            "number_of_donations": 3,
                            "fundraiser_primary_image_filename": "/path/to/image.png",
                            "team_fundraiser_type_id": 1,
                            "team_fundraiser_type": "Corporate team fundraiser",
                            "umbrella_team_id": 2,
                            "umbrella_team_name": "Umbrella Team",
                            "external_fundraiser_id": "abc1234",
                            "minimum_commitment_level_id": 1000,
                            "minimum_commitment_level_name": "Minimum commitment level name",
                            "minimum_commitment_level_amount": "$250.00"
                        }
                    ]
                }
            }
        },
        "securitySchemes": {
            "oauth2": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT",
                "description": "OAuth2 Bearer token authentication. Use the access token obtained from the OAuth2 flow in the Authorization header as: `Authorization: Bearer {access_token}`. For complete OAuth2 implementation details including endpoints, parameters, and flow specifications, see the [OAuth2 Authentication API Specification](https://runsignup.com/API/OAuth2/openapi-spec.json). For client registration and setup guidance, visit the [OAuth2 Developer Guide](https://runsignup.com/Profile/OAuth2/DeveloperGuide)."
            },
            "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": {
        "/v2/race-fundraisers/get-race-fundraisers.json": {
            "get": {
                "tags": [
                    "Race Fundraisers"
                ],
                "summary": "Get Fundraisers for Races",
                "description": "Get list of race fundraisers. This API supports OAuth2 Bearer token authentication.",
                "operationId": "v2_race_fundraisers_get_race_fundraisers_json",
                "parameters": [
                    {
                        "name": "race_id",
                        "in": "query",
                        "description": "ID of race.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "api_key",
                        "in": "query",
                        "description": "Race API key.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "api_secret",
                        "in": "query",
                        "description": "Race API secret.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "donation_period_id",
                        "in": "query",
                        "description": "Get fundraisers associated with a donation period ID.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "Number of results per page. The allowed range per page is from 1 - 500, outside this range it defaults to 50 per page.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": "50"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Number of pages.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": "1"
                        }
                    },
                    {
                        "name": "modified_after_ts",
                        "in": "query",
                        "description": "Get fundraisers updated after the provided timestamp.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "modified_before_ts",
                        "in": "query",
                        "description": "Get fundraisers updated before the provided timestamp.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include_amount_raised",
                        "in": "query",
                        "description": "Get amount raised for fundraisers?",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "modified_field",
                        "in": "query",
                        "description": "Consider only metadata changes or metadata and donation amount changes? Allowed values are 'meta' or 'meta_or_donation'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "meta"
                        }
                    },
                    {
                        "name": "include_number_of_donations",
                        "in": "query",
                        "description": "Include number of donations.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "include_fundraiser_profile_images",
                        "in": "query",
                        "description": "Include fundraiser profile image.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "included_fundraiser_types",
                        "in": "query",
                        "description": "Include fundraisers types. Allowed values: 'any', 'individuals', 'teams'",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "any"
                        }
                    },
                    {
                        "name": "include_fundraiser_type_info",
                        "in": "query",
                        "description": "Include team fundraiser type info.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "include_umbrella_teams",
                        "in": "query",
                        "description": "Include umbrella team info.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "include_import_data",
                        "in": "query",
                        "description": "(Deprecated: Use `include_external_fundraiser_ids` instead.) Include external fundraiser info.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "include_external_fundraiser_ids",
                        "in": "query",
                        "description": "Include external fundraiser info.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "include_minimum_commitment_data",
                        "in": "query",
                        "description": "Include minimum commitment info.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "enum": [
                                "T",
                                "F"
                            ],
                            "default": "F"
                        }
                    },
                    {
                        "name": "registration_id",
                        "in": "query",
                        "description": "Get fundraiser associated with a registration ID.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fundraiser_id",
                        "in": "query",
                        "description": "Get fundraiser associated with a fundraiser ID.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after_fundraiser_id",
                        "in": "query",
                        "description": "Get fundraisers with IDs greater than specified fundraiser ID.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort by \u201ccreated_ts\u201d, \u201clast_modified_ts\u201d, \u201crace_fundraiser_id\u201d, or \u201camount_raised\u201d.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort_direction",
                        "in": "query",
                        "description": "Sort direction. Only applicable if `sort` is specified.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "ASC"
                        }
                    }
                ],
                "security": [
                    {
                        "oauth2": []
                    },
                    {
                        "apiKey": [],
                        "apiSecret": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Race Fundraisers Response - Response containing list of race fundraisers. Additional fields are included based on request parameters.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/V2RaceFundraisersGetRaceFundraisersGetResponse"
                                }
                            }
                        }
                    },
                    "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"
                ]
            }
        }
    }
}