# Search Resources, including by capability and availability

Return a filtered list of Resources matched and scored against the supplied capabilities. Each result carries a capability-match score. When availability.minimumPercentage is supplied each result also carries an AvailabilityRecords array of weekly availability records (StartDate, EndDate, Percentage) covering the search window.

Endpoint: POST /api/resource-search
Version: 1.13
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Request fields (application/json):

  - `ActivityRoleId` (string)
    An activity role id to search for resources. Filters on the resource having the activity role

  - `CalendarId` (string)
    A calendar id to search for resources. Filters on the resource having the specified calendar

  - `Capabilities` (array)
    Capability filter objects. Each entry requires a CapabilityTypeId (Salesforce Id, obtained from list_or_search_capability_types), plus optional matching criteria. Resources are found and scored by how well they match.

  - `Capabilities.CapabilityTypeId` (string)
    Salesforce Id of the CapabilityType. Use list_or_search_capability_types to obtain this Id — pass the Capability name from get_assignment_required_capabilities as the name filter to resolve it.

  - `Capabilities.RatingType` (string)
    Use the RatingType returned by list_or_search_capability_types for this capability type (e.g. NumericRating or BooleanRating).

  - `Capabilities.MinimumRating` (number)
    Optional. Minimum rating 0-5.

  - `Capabilities.IsMandatory` (boolean)
    Optional. Whether the resource must hold this capability.

  - `Capabilities.MatchingRule` (string, required)
    Required. Always set this. Use the MatchingRule from list_or_search_capability_types if non-null. If null: use MatchOrExceed when MinimumRating is set, otherwise use Any. Maps from CapabilityMatchingRule in get_assignment_required_capabilities.

  - `Capabilities.Weighting` (number)
    Optional. Score weighting.

  - `Availability` (object)
    Availability filter object. Fields: FromDate (YYYY-MM-DD, required with MinimumPercentage), ToDate (YYYY-MM-DD, required with MinimumPercentage), MinimumPercentage (0-100), MatchSetting (Full: every week must meet minimum; Partial: at least one week).

  - `BusinessUnitId` (string)
    A Business Unit id to search for resources. Filters on the resource having the specified Business Unit

  - `GradeId` (string)
    A Grade id to search for resources. Filters on the resource having the specified Grade

  - `LocationId` (string)
    A Location id to search for resources. Filters on the resource having the specified Location

  - `ResourceTypeId` (string)
    A Resource Type id to search for resources. Filters on the resource having the specified Resource Type

  - `SupplyBusinessUnitId` (string)
    A Supply Business Unit id to search for resources. Filters on the resource having the specified Supply Business Unit

  - `Name` (string)
    Find resources exact match on resource name

  - `NameLike` (string)
    Find resources where their name begins with the specified value

  - `UserEmail` (string)
    Find resources where their email address begins with the specified value

  - `CustomFilters` (array)
    Optional list of filters against custom fields exposed via the APIListFields field set on Resource. Each entry requires FieldPath (the field API name, Value, and Operator (Equals or Like).

  - `CustomFilters.FieldPath` (string, required)
    API name of a field included in the APIListFields field set on Resource (e.g. as returned in ReturnFields). The field must support filtering. Allowed values for this org: {!APIListFields:KimbleOne__Resource__c}

  - `CustomFilters.Value` (string, required)
    Value to match on the field.

  - `CustomFilters.Operator` (string, required)
    Match type for this filter. One of Equals (exact match) or Like (partial/contains match).

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `paging` (object)

  - `paging.totalItems` (integer)

  - `paging.pageSize` (integer)

  - `paging.nextRecordsUrl` (string)

  - `paging.done` (boolean)

  - `paging.count` (integer)

  - `data` (array)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `message` (string, required)

  - `errorCode` (string, required)

  - `details` (object)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `message` (string, required)

  - `errorCode` (string, required)

  - `details` (object)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `message` (string, required)

  - `errorCode` (string, required)

  - `details` (object)

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `message` (string, required)

  - `errorCode` (string, required)

  - `details` (object)

## Response 500:

  - `500` (unknown)
    Server Error

## Response 500 fields (application/json):

  - `message` (string, required)

  - `errorCode` (string, required)

  - `details` (object)

